diff --git a/application/src/Entity/Source/Data/NameSource.php b/application/src/Entity/Source/Data/NameSource.php index d29c2e8..2c2381e 100644 --- a/application/src/Entity/Source/Data/NameSource.php +++ b/application/src/Entity/Source/Data/NameSource.php @@ -26,6 +26,5 @@ final class NameSource extends AbstractDataSource implements NameSourceInterface public function __construct() { parent::__construct(); - $this->name = ''; } } diff --git a/application/tests/Unit/Entity/Source/NameSourceTest.php b/application/tests/Unit/Entity/Source/Data/NameSourceTest.php similarity index 57% rename from application/tests/Unit/Entity/Source/NameSourceTest.php rename to application/tests/Unit/Entity/Source/Data/NameSourceTest.php index 9f882c7..e0b7d2c 100644 --- a/application/tests/Unit/Entity/Source/NameSourceTest.php +++ b/application/tests/Unit/Entity/Source/Data/NameSourceTest.php @@ -1,10 +1,10 @@ nameSource = new NameSource(); } + public function testConstructor():void{ + $this->assertInstanceOf(NameSourceInterface::class, $this->nameSource); + $this->expectException(\TypeError::class); + $this->nameSource->getName(); + } + public function testName(): void { - $this->assertEquals('', $this->nameSource->getName()); $name = 'Hello World!'; $this->nameSource->setName($name); $this->assertEquals($name, $this->nameSource->getName()); diff --git a/application/tests/Unit/Entity/UserTest.php b/application/tests/Unit/Entity/UserTest.php index 7086725..ca64f70 100644 --- a/application/tests/Unit/Entity/UserTest.php +++ b/application/tests/Unit/Entity/UserTest.php @@ -4,7 +4,7 @@ namespace tests\unit\Entity; use PHPUnit\Framework\TestCase; use App\Entity\User; -use App\Entity\Source\UserSource; +use App\Entity\Source\Data\UserSource; use App\Entity\UserInterface; /**