From 45a1fc66781b79d3c208c8a1cad4a244733141f5 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 4 Nov 2018 12:49:42 +0100 Subject: [PATCH] Implemented test for NameSourceAttribut --- .../Attribut/NameSourceAttributTest.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 application/tests/Unit/Entity/Attribut/NameSourceAttributTest.php diff --git a/application/tests/Unit/Entity/Attribut/NameSourceAttributTest.php b/application/tests/Unit/Entity/Attribut/NameSourceAttributTest.php new file mode 100644 index 0000000..828a0ba --- /dev/null +++ b/application/tests/Unit/Entity/Attribut/NameSourceAttributTest.php @@ -0,0 +1,36 @@ +name = new class() implements NameSourceAttributInterface { + use NameSourceAttribut; + }; + } + + public function testConstructor(): void + { + $this->expectException(\TypeError::class); + $this->name->getNameSource(); + } + + public function testAccessors(): void + { + $nameSource = $this->createMock(NameSourceInterface::class); + $this->assertNull($this->name->setNameSource($nameSource)); + $this->assertEquals($nameSource, $this->name->getNameSource()); + } +}