right = new Right(); } public function testConstructorGeneral(): void { $this->assertTrue($this->right->getGrant()); $this->assertEquals(0, $this->right->getPriority()); } public function testConstructorReciever(): void { $this->expectException(\TypeError::class); $this->right->getReciever(); } public function testConstructorLayer(): void { $this->expectException(\TypeError::class); $this->assertNull($this->right->getLayer()); } public function testConstructorLaw(): void { $this->expectException(\TypeError::class); $this->assertNull($this->right->getLaw()); } public function testConstructorCondition(): void { $this->expectException(\TypeError::class); $this->right->getCondition(); } public function testConstructorType(): void { $this->expectException(\TypeError::class); $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 { foreach (RightType::getChoices() as $key => $value) { $this->assertNull($this->right->setType($key)); $this->assertEquals($key, $this->right->getType()); } $this->expectException(NoValidChoice::class); $this->right->setType('NoneValidType'); } public function testLayer(): void { foreach (LayerType::getChoices() as $key => $value) { $this->assertNull($this->right->setLayer($key)); $this->assertEquals($key, $this->right->getLayer()); } $this->expectException(NoValidChoice::class); $this->right->setLayer('NoneValidLayer'); } }