diff --git a/application/src/Entity/Attribut/TextAttribut.php b/application/src/Entity/Attribut/TextAttribut.php new file mode 100644 index 0000000..eb05481 --- /dev/null +++ b/application/src/Entity/Attribut/TextAttribut.php @@ -0,0 +1,21 @@ +text; + } + + public function setText(string $text): void + { + $this->text = $text; + } +} diff --git a/application/src/Entity/Attribut/TextAttributInterface.php b/application/src/Entity/Attribut/TextAttributInterface.php new file mode 100644 index 0000000..216dc90 --- /dev/null +++ b/application/src/Entity/Attribut/TextAttributInterface.php @@ -0,0 +1,10 @@ +textAttribut = new class() implements TextAttributInterface { + use TextAttribut; + }; + } + + public function testConstructor(): void + { + $this->expectException(\TypeError::class); + $this->textAttribut->getText(); + } + + public function testAccessors(): void + { + $text = 'Hello World!'; + $this->assertNull($this->textAttribut->setText($text)); + $this->assertEquals($text, $this->textAttribut->getText()); + } +} diff --git a/application/tests/Unit/Entity/Source/Primitive/Text/TextSourceTest.php b/application/tests/Unit/Entity/Source/Primitive/Text/TextSourceTest.php new file mode 100644 index 0000000..c34e020 --- /dev/null +++ b/application/tests/Unit/Entity/Source/Primitive/Text/TextSourceTest.php @@ -0,0 +1,26 @@ +textSource = new TextSource(); + } + + public function testConstructor(): void + { + $this->expectException(\TypeError::class); + $this->textSource->getText(); + } +}