From 2b63e0e4478bb3bcc3fc7364bcd98a9ed42532b6 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 13 Jan 2019 20:43:33 +0100 Subject: [PATCH] Optimized tests for AbstractEntity and UserSourceDirectoryService --- .../UserSourceDirectorServiceTest.php | 37 +++++++++++++++++++ .../tests/Unit/Entity/AbstractEntityTest.php | 5 --- 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 application/symfony/tests/Unit/Domain/UserManagement/UserSourceDirectorServiceTest.php diff --git a/application/symfony/tests/Unit/Domain/UserManagement/UserSourceDirectorServiceTest.php b/application/symfony/tests/Unit/Domain/UserManagement/UserSourceDirectorServiceTest.php new file mode 100644 index 0000000..8c82077 --- /dev/null +++ b/application/symfony/tests/Unit/Domain/UserManagement/UserSourceDirectorServiceTest.php @@ -0,0 +1,37 @@ +get('doctrine.orm.default_entity_manager'); + $this->userSourceDirectorService = new UserSourceDirectorService($entityManager, $security); + } + + public function testGuestUser(): void + { + $user = $this->userSourceDirectorService->getUser(); + $this->assertInstanceOf(User::class, $user); + $this->assertInstanceOf(SourceInterface::class, $user->getSource()); + } +} diff --git a/application/symfony/tests/Unit/Entity/AbstractEntityTest.php b/application/symfony/tests/Unit/Entity/AbstractEntityTest.php index 186b2fe..54cb46f 100644 --- a/application/symfony/tests/Unit/Entity/AbstractEntityTest.php +++ b/application/symfony/tests/Unit/Entity/AbstractEntityTest.php @@ -39,9 +39,4 @@ class AbstractEntityTest extends TestCase $this->assertNull($this->entity->setId($id)); $this->assertEquals($id, $this->entity->getId()); } - - public function testToString(): void - { - $this->assertEquals(true, is_string($this->entity->__toString())); - } }