diff --git a/application/src/Entity/Attribut/CollectionAttribut.php b/application/src/Entity/Attribut/CollectionAttribut.php new file mode 100644 index 0000000..8e0678b --- /dev/null +++ b/application/src/Entity/Attribut/CollectionAttribut.php @@ -0,0 +1,29 @@ +collection; + } + + /** + * @param Collection $collection + */ + public function setCollection(Collection $collection): void + { + $this->collection = $collection; + } +} diff --git a/application/src/Entity/Attribut/CollectionAttributInterface.php b/application/src/Entity/Attribut/CollectionAttributInterface.php new file mode 100644 index 0000000..6889cde --- /dev/null +++ b/application/src/Entity/Attribut/CollectionAttributInterface.php @@ -0,0 +1,12 @@ +collection = new class() implements CollectionAttributInterface { + use CollectionAttribut; + }; + } + + public function testConstructor(): void + { + $this->expectException(\TypeError::class); + $this->collection->getCollection(); + } + + public function testAccessors(): void + { + $collection = new ArrayCollection(); + $this->assertNull($this->collection->setCollection($collection)); + $this->assertEquals($collection, $this->collection->getCollection()); + } +}