diff --git a/application/src/DataFixtures/DummyFixtures.php b/application/src/DataFixtures/DummyFixtures.php index 9e190c4..8ff377a 100644 --- a/application/src/DataFixtures/DummyFixtures.php +++ b/application/src/DataFixtures/DummyFixtures.php @@ -8,8 +8,8 @@ use App\Entity\User; /** * Never execute this fixture on a livesystem! - * @author kevinfrantz * + * @author kevinfrantz */ class DummyFixtures extends Fixture { diff --git a/application/src/Entity/Source/Data/AbstractDataSource.php b/application/src/Entity/Source/Data/AbstractDataSource.php index 1b137d7..9c823c2 100644 --- a/application/src/Entity/Source/Data/AbstractDataSource.php +++ b/application/src/Entity/Source/Data/AbstractDataSource.php @@ -1,7 +1,10 @@ name = new class implements NameAttributInterface{ + + public function setUp(): void + { + $this->name = new class() implements NameAttributInterface { use NameAttribut; }; } - - public function testConstructor():void{ + + public function testConstructor(): void + { $this->expectException(\TypeError::class); $this->name->getName(); } - - public function testAccessors():void{ - $name = "hello world!"; + + public function testAccessors(): void + { + $name = 'hello world!'; $this->assertNull($this->name->setName($name)); $this->assertEquals($name, $this->name->getName()); } } - diff --git a/application/tests/Unit/Entity/Source/Data/NameSourceTest.php b/application/tests/Unit/Entity/Source/Data/NameSourceTest.php index e0b7d2c..e699048 100644 --- a/application/tests/Unit/Entity/Source/Data/NameSourceTest.php +++ b/application/tests/Unit/Entity/Source/Data/NameSourceTest.php @@ -21,12 +21,13 @@ class NameSourceTest extends TestCase $this->nameSource = new NameSource(); } - public function testConstructor():void{ + public function testConstructor(): void + { $this->assertInstanceOf(NameSourceInterface::class, $this->nameSource); $this->expectException(\TypeError::class); $this->nameSource->getName(); } - + public function testName(): void { $name = 'Hello World!'; diff --git a/application/tests/Unit/Entity/Source/Data/UserSourceTest.php b/application/tests/Unit/Entity/Source/Data/UserSourceTest.php index 8fa4324..bfa868c 100644 --- a/application/tests/Unit/Entity/Source/Data/UserSourceTest.php +++ b/application/tests/Unit/Entity/Source/Data/UserSourceTest.php @@ -1,4 +1,5 @@ userSource = new UserSource(); } - - public function testConstructor():void { + + public function testConstructor(): void + { $this->assertInstanceOf(Collection::class, $this->userSource->getMemberships()); $this->assertInstanceOf(NameSourceInterface::class, $this->userSource->getNameSource()); } } -