diff --git a/application/src/Entity/AbstractEntity.php b/application/src/Entity/AbstractEntity.php index 7a5f7fd..9590092 100644 --- a/application/src/Entity/AbstractEntity.php +++ b/application/src/Entity/AbstractEntity.php @@ -31,6 +31,5 @@ abstract class AbstractEntity implements EntityInterface public function __construct() { - // $this->id = 0; } } diff --git a/application/src/Entity/Meta/Relation.php b/application/src/Entity/Meta/Relation.php index 6177050..1d4e626 100644 --- a/application/src/Entity/Meta/Relation.php +++ b/application/src/Entity/Meta/Relation.php @@ -81,6 +81,5 @@ final class Relation extends AbstractMeta implements RelationInterface $this->law = new Law(); $this->parents = new ArrayCollection(); $this->childs = new ArrayCollection(); - //$this->law->setNode($this); } } diff --git a/application/tests/unit/Entity/AbstractEntityTest.php b/application/tests/unit/Entity/AbstractEntityTest.php new file mode 100644 index 0000000..41b0fe0 --- /dev/null +++ b/application/tests/unit/Entity/AbstractEntityTest.php @@ -0,0 +1,40 @@ +entity = new class() extends AbstractEntity { + }; + } + + public function testConstructor(): void + { + $this->expectException(\TypeError::class); + $this->entity->getId(); + $this->entity->getVersion(); + } + + public function testVersion(): void + { + $version = 123; + $this->assertNull($this->entity->setVersion($version)); + $this->assertEquals($version, $this->entity->getVersion()); + } + + public function testId(): void + { + $id = 123; + $this->assertNull($this->entity->setId($id)); + $this->assertEquals($id, $this->entity->getId()); + } +}