Declared setActionType as immutable for RequestedRight

This commit is contained in:
Kevin Frantz
2019-02-26 19:49:19 +01:00
parent 9d63f34a7b
commit 776a7fe282
3 changed files with 32 additions and 3 deletions

View File

@@ -16,6 +16,8 @@ use Infinito\Domain\RepositoryManagement\LayerRepositoryFactoryService;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Infinito\Entity\Meta\Law;
use Infinito\Entity\Source\SourceInterface;
use Infinito\DBAL\Types\ActionType;
use Infinito\Exception\AllreadySetException;
/**
* @author kevinfrantz
@@ -105,4 +107,13 @@ class RequestedRightTest extends KernelTestCase
$responseSource1 = $this->requestedRight->getSource();
$this->assertEquals($responseSource1, $source);
}
public function testSetActionType(): void
{
$attributType = ActionType::CREATE;
$this->requestedRight->setActionType($attributType);
$this->assertEquals($attributType, $this->requestedRight->getActionType());
$this->expectException(AllreadySetException::class);
$this->requestedRight->setActionType($attributType);
}
}