From 2e9b33c82b8979cbe4112c7898174e8d1172f757 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 4 Nov 2018 13:05:35 +0100 Subject: [PATCH] Implemented tests for relation --- application/src/Entity/Meta/Relation.php | 3 +- .../tests/Unit/Entity/Meta/RelationTest.php | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 application/tests/Unit/Entity/Meta/RelationTest.php diff --git a/application/src/Entity/Meta/Relation.php b/application/src/Entity/Meta/Relation.php index 9b882dd..9d50c31 100644 --- a/application/src/Entity/Meta/Relation.php +++ b/application/src/Entity/Meta/Relation.php @@ -14,8 +14,7 @@ use Doctrine\Common\Collections\Collection; /** * This class represents a relation. - * It allows a better right management of the meta informations. - * Also it is used to capsel the logic relation to an own logical unit. + * A relationship represents the creators and the created objects. * * @author kevinfrantz * diff --git a/application/tests/Unit/Entity/Meta/RelationTest.php b/application/tests/Unit/Entity/Meta/RelationTest.php new file mode 100644 index 0000000..f8d6508 --- /dev/null +++ b/application/tests/Unit/Entity/Meta/RelationTest.php @@ -0,0 +1,28 @@ +relation = new Relation(); + } + + 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(); + } +} +