From 577f30e0f7561e71d526bc6b8c2eb86e198e29f2 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 4 Nov 2018 12:25:53 +0100 Subject: [PATCH] Applied code formator --- .../src/DataFixtures/DummyFixtures.php | 2 +- .../Entity/Source/Data/AbstractDataSource.php | 7 ++++--- .../Source/Data/DataSourceInterface.php | 2 +- .../src/Entity/Source/Data/NameSource.php | 2 +- .../Source/Data/UserSourceInterface.php | 1 - .../Unit/Entity/Attribut/NameAttributTest.php | 21 +++++++++++-------- .../Entity/Source/Data/NameSourceTest.php | 5 +++-- .../Entity/Source/Data/UserSourceTest.php | 13 ++++++------ 8 files changed, 29 insertions(+), 24 deletions(-) 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()); } } -