diff --git a/application/tests/Unit/Entity/Attribut/ChildsAttributTest.php b/application/tests/Unit/Entity/Attribut/ChildsAttributTest.php new file mode 100644 index 0000000..6777300 --- /dev/null +++ b/application/tests/Unit/Entity/Attribut/ChildsAttributTest.php @@ -0,0 +1,36 @@ +childs = new class() implements ChildsAttributeInterface { + use ChildsAttribut; + }; + } + + public function testConstructor(): void + { + $this->expectException(\TypeError::class); + $this->childs->getChilds(); + } + + public function testAccessors(): void + { + $childs = new ArrayCollection(); + $this->assertNull($this->childs->setChilds($childs)); + $this->assertEquals($childs, $this->childs->getChilds()); + } +} diff --git a/application/tests/Unit/Entity/Meta/RelationTest.php b/application/tests/Unit/Entity/Meta/RelationTest.php index f8d6508..cf52f84 100644 --- a/application/tests/Unit/Entity/Meta/RelationTest.php +++ b/application/tests/Unit/Entity/Meta/RelationTest.php @@ -1,4 +1,5 @@ relation = new Relation(); } - - public function testConstructor():void { + + public function testConstructor(): void + { $this->assertInstanceOf(Collection::class, $this->relation->getChilds()); $this->assertInstanceOf(Collection::class, $this->relation->getParents()); $this->expectException(\TypeError::class); $this->relation->getSource(); } } -