diff --git a/application/src/Entity/Meta/Right.php b/application/src/Entity/Meta/Right.php index d78b574..f59edde 100644 --- a/application/src/Entity/Meta/Right.php +++ b/application/src/Entity/Meta/Right.php @@ -83,8 +83,6 @@ final class Right extends AbstractMeta implements RightInterface { parent::__construct(); $this->grant = true; - //$this->node = new Node(); - //$this->recieverGroup = new RecieverGroup(); } public function isGranted(RelationInterface $relation, string $layer, string $right): bool diff --git a/application/tests/unit/Entity/Meta/RightTest.php b/application/tests/unit/Entity/Meta/RightTest.php new file mode 100644 index 0000000..0c5b8a6 --- /dev/null +++ b/application/tests/unit/Entity/Meta/RightTest.php @@ -0,0 +1,44 @@ +right = new Right(); + } + + public function testConstructor(): void + { + $this->expectException(\TypeError::class); + $this->assertNull($this->right->getLaw()); + $this->assertNull($this->right->getType()); + } + + public function testLaw(): void + { + $law = new Law(); + $this->assertNull($this->right->setLaw($law)); + $this->assertEquals($law, $this->right->getLaw()); + } + + public function testRight(): void + { + $this->assertNull($this->right->setType(RightType::READ)); + $this->assertEquals(RightType::READ, $this->right->getType()); + } +}