From 03ce3f5cdf4ad616a7c39a0d34bc958391956b7c Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 4 Nov 2018 12:12:34 +0100 Subject: [PATCH] Implemented test for name attribut --- .../Unit/Entity/Attribut/NameAttributTest.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 application/tests/Unit/Entity/Attribut/NameAttributTest.php diff --git a/application/tests/Unit/Entity/Attribut/NameAttributTest.php b/application/tests/Unit/Entity/Attribut/NameAttributTest.php new file mode 100644 index 0000000..e939169 --- /dev/null +++ b/application/tests/Unit/Entity/Attribut/NameAttributTest.php @@ -0,0 +1,30 @@ +name = new class implements NameAttributInterface{ + use NameAttribut; + }; + } + + public function testConstructor():void{ + $this->expectException(\TypeError::class); + $this->name->getName(); + } + + public function testAccessors():void{ + $name = "hello world!"; + $this->assertNull($this->name->setName($name)); + $this->assertEquals($name, $this->name->getName()); + } +} +