diff --git a/application/symfony/src/Controller/API/Source/SourceApiController.php b/application/symfony/src/Controller/API/Source/SourceApiController.php index a48c022..2f573be 100644 --- a/application/symfony/src/Controller/API/Source/SourceApiController.php +++ b/application/symfony/src/Controller/API/Source/SourceApiController.php @@ -68,7 +68,7 @@ class SourceApiController extends AbstractAPIController // // $requestedRight = new Right(); // // $requestedRight->setSource($requestedSource); // // $requestedRight->setLayer(LayerType::SOURCE); - // // $requestedRight->setType(CRUDType::READ); + // // $requestedRight->setCrud(CRUDType::READ); // // $sourceResponseManager = new SourceRESTResponseManager($this->getUser(), $entityManager, $requestedRight, $this->getViewHandler()); // // return $sourceResponseManager->getResponse(); diff --git a/application/symfony/src/Controller/DefaultController.php b/application/symfony/src/Controller/DefaultController.php index dbebcfc..8769c39 100644 --- a/application/symfony/src/Controller/DefaultController.php +++ b/application/symfony/src/Controller/DefaultController.php @@ -32,7 +32,7 @@ final class DefaultController extends AbstractController $requestedRight = new Right(); $requestedRight->setSource($requestedSource); $requestedRight->setLayer(LayerType::SOURCE); - $requestedRight->setType(CRUDType::READ); + $requestedRight->setCrud(CRUDType::READ); $sourceResponseManager = new SourceRESTResponseManager($this->getUser(), $entityManager, $requestedRight, $this->getViewHandler()); return $sourceResponseManager->getResponse(); diff --git a/application/symfony/src/DataFixtures/SourceFixtures.php b/application/symfony/src/DataFixtures/SourceFixtures.php index c82d3a9..9585eb7 100644 --- a/application/symfony/src/DataFixtures/SourceFixtures.php +++ b/application/symfony/src/DataFixtures/SourceFixtures.php @@ -65,7 +65,7 @@ class SourceFixtures extends Fixture $sourceRightManager = new SourceRightManager($this->impressumSource); $sourceRightManager->addRight($right); $right->setLayer(LayerType::SOURCE); - $right->setType(CRUDType::READ); + $right->setCrud(CRUDType::READ); $right->setReciever($this->guestUserSource); return $right; diff --git a/application/symfony/src/Domain/LawManagement/LawPermissionCheckerService.php b/application/symfony/src/Domain/LawManagement/LawPermissionCheckerService.php index 9c30e65..6dab096 100644 --- a/application/symfony/src/Domain/LawManagement/LawPermissionCheckerService.php +++ b/application/symfony/src/Domain/LawManagement/LawPermissionCheckerService.php @@ -49,9 +49,9 @@ final class LawPermissionCheckerService implements LawPermissionCheckerServiceIn * * @return Collection|RightInterface[] */ - private function getRightsByType(Collection $rights, string $type): Collection + private function getRightsByCrud(Collection $rights, string $type): Collection { - return $this->getFilteredRights($rights, $type, 'Type'); + return $this->getFilteredRights($rights, $type, 'Crud'); } /** @@ -139,7 +139,7 @@ final class LawPermissionCheckerService implements LawPermissionCheckerServiceIn $right = $rights[0]; $rightChecker = new RightChecker($right); - return $rightChecker->isGranted($client->getLayer(), $client->getType(), $client->getReciever()); + return $rightChecker->isGranted($client->getLayer(), $client->getCrud(), $client->getReciever()); } public function __construct(LawInterface $law) @@ -150,7 +150,7 @@ final class LawPermissionCheckerService implements LawPermissionCheckerServiceIn public function hasPermission(RightInterface $clientRight): bool { $rights = clone $this->law->getRights(); - $rights = $this->getRightsByType($rights, $clientRight->getType()); + $rights = $this->getRightsByCrud($rights, $clientRight->getCrud()); $rights = $this->getRightsByLayer($rights, $clientRight->getLayer()); $rights = $this->getRightsByReciever($rights, $clientRight->getReciever()); $rights = $this->sortByPriority($rights); diff --git a/application/symfony/src/Domain/RequestManagement/RequestedRight.php b/application/symfony/src/Domain/RequestManagement/RequestedRight.php index ca70df7..342b6e7 100644 --- a/application/symfony/src/Domain/RequestManagement/RequestedRight.php +++ b/application/symfony/src/Domain/RequestManagement/RequestedRight.php @@ -3,7 +3,7 @@ namespace App\Domain\RequestManagement; use App\Entity\Source\SourceInterface; -use App\Entity\Attribut\TypeAttribut; +use App\Entity\Attribut\CrudAttribut; use App\Entity\Attribut\LayerAttribut; use App\Entity\Attribut\RecieverAttribut; use App\Exception\PreconditionFailedException; @@ -17,7 +17,7 @@ use App\Repository\Source\SourceRepositoryInterface; */ class RequestedRight implements RequestedRightInterface { - use TypeAttribut, LayerAttribut, RecieverAttribut; + use CrudAttribut, LayerAttribut, RecieverAttribut; /** * @var SourceRepositoryInterface diff --git a/application/symfony/src/Domain/RequestManagement/RequestedRightInterface.php b/application/symfony/src/Domain/RequestManagement/RequestedRightInterface.php index 522c1aa..807d1a6 100644 --- a/application/symfony/src/Domain/RequestManagement/RequestedRightInterface.php +++ b/application/symfony/src/Domain/RequestManagement/RequestedRightInterface.php @@ -2,7 +2,7 @@ namespace App\Domain\RequestManagement; -use App\Entity\Attribut\TypeAttributInterface; +use App\Entity\Attribut\CrudAttributInterface; use App\Entity\Attribut\RecieverAttributInterface; use App\Entity\Attribut\LayerAttributInterface; use App\Entity\Source\SourceInterface; @@ -10,7 +10,7 @@ use App\Entity\Source\SourceInterface; /** * @author kevinfrantz */ -interface RequestedRightInterface extends TypeAttributInterface, RecieverAttributInterface, LayerAttributInterface +interface RequestedRightInterface extends CrudAttributInterface, RecieverAttributInterface, LayerAttributInterface { /** * @param RequestedSourceInterface $requestedSource diff --git a/application/symfony/src/Domain/RequestManagement/RequestedUserRightFacade.php b/application/symfony/src/Domain/RequestManagement/RequestedUserRightFacade.php index 6385c1d..5bb822a 100644 --- a/application/symfony/src/Domain/RequestManagement/RequestedUserRightFacade.php +++ b/application/symfony/src/Domain/RequestManagement/RequestedUserRightFacade.php @@ -63,11 +63,11 @@ final class RequestedUserRightFacade implements RequestedUserRightFacadeInterfac /** * {@inheritdoc} * - * @see \App\Entity\Attribut\TypeAttributInterface::getType() + * @see \App\Entity\Attribut\CrudAttributInterface::getCrud() */ - public function getType(): string + public function getCrud(): string { - return $this->requestedRight->getType(); + return $this->requestedRight->getCrud(); } /** @@ -93,11 +93,11 @@ final class RequestedUserRightFacade implements RequestedUserRightFacadeInterfac /** * {@inheritdoc} * - * @see \App\Entity\Attribut\TypeAttributInterface::setType() + * @see \App\Entity\Attribut\CrudAttributInterface::setCrud() */ - public function setType(string $type): void + public function setCrud(string $type): void { - $this->requestedRight->setType($type); + $this->requestedRight->setCrud($type); } /** diff --git a/application/symfony/src/Domain/RightManagement/RightChecker.php b/application/symfony/src/Domain/RightManagement/RightChecker.php index 9a7e041..3217ef0 100644 --- a/application/symfony/src/Domain/RightManagement/RightChecker.php +++ b/application/symfony/src/Domain/RightManagement/RightChecker.php @@ -45,7 +45,7 @@ final class RightChecker implements RightCheckerInterface private function isTypeEqual(string $type): bool { - return $this->right->getType() === $type; + return $this->right->getCrud() === $type; } private function checkPermission(): bool diff --git a/application/symfony/src/Domain/SecureCRUDManagement/Factory/SecureCRUDFactoryService.php b/application/symfony/src/Domain/SecureCRUDManagement/Factory/SecureCRUDFactoryService.php index dd66d7b..fbd74c4 100644 --- a/application/symfony/src/Domain/SecureCRUDManagement/Factory/SecureCRUDFactoryService.php +++ b/application/symfony/src/Domain/SecureCRUDManagement/Factory/SecureCRUDFactoryService.php @@ -51,7 +51,7 @@ final class SecureCRUDFactoryService extends AbstractSecureCRUDService implement */ public function create(RightInterface $requestedRight): SecureCRUDServiceInterface { - $namespace = $this->getCRUDNamespace($requestedRight->getLayer(), $requestedRight->getType()); + $namespace = $this->getCRUDNamespace($requestedRight->getLayer(), $requestedRight->getCrud()); return new $namespace($this->requestStack, $this->security, $this->entityManager); } diff --git a/application/symfony/src/Domain/TemplateManagement/TemplatePathInformation.php b/application/symfony/src/Domain/TemplateManagement/TemplatePathInformation.php index 8b2db16..8439cf1 100644 --- a/application/symfony/src/Domain/TemplateManagement/TemplatePathInformation.php +++ b/application/symfony/src/Domain/TemplateManagement/TemplatePathInformation.php @@ -119,9 +119,9 @@ final class TemplatePathInformation implements TemplatePathInformationInterface /** * {@inheritdoc} * - * @see \App\Domain\TemplateManagement\TemplatePathInformationInterface::getType() + * @see \App\Domain\TemplateManagement\TemplatePathInformationInterface::getCrud() */ - public function getType(): string + public function getCrud(): string { return $this->type; } diff --git a/application/symfony/src/Domain/TemplateManagement/TemplatePathInformationInterface.php b/application/symfony/src/Domain/TemplateManagement/TemplatePathInformationInterface.php index 7ea350b..45c3b9f 100644 --- a/application/symfony/src/Domain/TemplateManagement/TemplatePathInformationInterface.php +++ b/application/symfony/src/Domain/TemplateManagement/TemplatePathInformationInterface.php @@ -26,5 +26,5 @@ interface TemplatePathInformationInterface extends ReloadTypeInterface * * @return string Type of the template */ - public function getType(): string; + public function getCrud(): string; } diff --git a/application/symfony/src/Entity/Attribut/CrudAttribut.php b/application/symfony/src/Entity/Attribut/CrudAttribut.php new file mode 100644 index 0000000..7cf5b9e --- /dev/null +++ b/application/symfony/src/Entity/Attribut/CrudAttribut.php @@ -0,0 +1,32 @@ +crud = $crud; + } + + /** + * @return string + */ + public function getCrud(): string + { + return $this->crud; + } +} diff --git a/application/symfony/src/Entity/Attribut/CrudAttributInterface.php b/application/symfony/src/Entity/Attribut/CrudAttributInterface.php new file mode 100644 index 0000000..377e650 --- /dev/null +++ b/application/symfony/src/Entity/Attribut/CrudAttributInterface.php @@ -0,0 +1,13 @@ +type = $type; - } - - public function getType(): string - { - return $this->type; - } -} diff --git a/application/symfony/src/Entity/Attribut/TypeAttributInterface.php b/application/symfony/src/Entity/Attribut/TypeAttributInterface.php deleted file mode 100644 index 708ea9d..0000000 --- a/application/symfony/src/Entity/Attribut/TypeAttributInterface.php +++ /dev/null @@ -1,13 +0,0 @@ -type = $type; + $this->crud = $crud; } /** diff --git a/application/symfony/src/Entity/Meta/RightInterface.php b/application/symfony/src/Entity/Meta/RightInterface.php index f4207b1..e0b03a9 100644 --- a/application/symfony/src/Entity/Meta/RightInterface.php +++ b/application/symfony/src/Entity/Meta/RightInterface.php @@ -2,7 +2,7 @@ namespace App\Entity\Meta; -use App\Entity\Attribut\TypeAttributInterface; +use App\Entity\Attribut\CrudAttributInterface; use App\Entity\Attribut\LawAttributInterface; use App\Entity\Attribut\RecieverAttributInterface; use App\Entity\Attribut\GrantAttributInterface; @@ -14,6 +14,6 @@ use App\Entity\Attribut\PriorityAttributInterface; /** * @author kevinfrantz */ -interface RightInterface extends TypeAttributInterface, LawAttributInterface, GrantAttributInterface, RecieverAttributInterface, RelationAttributInterface, ConditionAttributInterface, LayerAttributInterface, MetaInterface, PriorityAttributInterface +interface RightInterface extends CrudAttributInterface, LawAttributInterface, GrantAttributInterface, RecieverAttributInterface, RelationAttributInterface, ConditionAttributInterface, LayerAttributInterface, MetaInterface, PriorityAttributInterface { } diff --git a/application/symfony/tests/Unit/Domain/LawManagement/LawPermissionCheckerTest.php b/application/symfony/tests/Unit/Domain/LawManagement/LawPermissionCheckerTest.php index 489ab47..f87cf1f 100644 --- a/application/symfony/tests/Unit/Domain/LawManagement/LawPermissionCheckerTest.php +++ b/application/symfony/tests/Unit/Domain/LawManagement/LawPermissionCheckerTest.php @@ -87,7 +87,7 @@ class LawPermissionCheckerTest extends TestCase { $this->clientRight = new Right(); $this->clientRight->setLayer(LayerType::SOURCE); - $this->clientRight->setType(CRUDType::READ); + $this->clientRight->setCrud(CRUDType::READ); $this->clientRight->setReciever($this->clientSource); $this->clientRight->setSource($this->source); } @@ -107,7 +107,7 @@ class LawPermissionCheckerTest extends TestCase { $this->law->getRights()->add($this->getClonedClientRight()); $this->assertTrue($this->checkClientPermission()); - $this->clientRight->setType(CRUDType::UPDATE); + $this->clientRight->setCrud(CRUDType::UPDATE); $this->assertFalse($this->checkClientPermission()); } @@ -142,10 +142,10 @@ class LawPermissionCheckerTest extends TestCase public function testGetRightsByType(): void { $right = $this->getClonedClientRight(); - $right->setType(CRUDType::UPDATE); + $right->setCrud(CRUDType::UPDATE); $this->law->getRights()->add($right); $this->assertFalse($this->checkClientPermission()); - $right->setType(CRUDType::READ); + $right->setCrud(CRUDType::READ); $this->assertTrue($this->checkClientPermission()); } diff --git a/application/symfony/tests/Unit/Domain/RequestManagement/RequestedUserRightFacadeTest.php b/application/symfony/tests/Unit/Domain/RequestManagement/RequestedUserRightFacadeTest.php index aa0a7c9..2966245 100644 --- a/application/symfony/tests/Unit/Domain/RequestManagement/RequestedUserRightFacadeTest.php +++ b/application/symfony/tests/Unit/Domain/RequestManagement/RequestedUserRightFacadeTest.php @@ -44,11 +44,11 @@ class RequestedUserRightFacadeTest extends TestCase $userSourceDirector->method('getUser')->willReturn($user); $requestedRight = $this->createMock(RequestedRightInterface::class); $requestedRight->method('getLayer')->willReturn($layer); - $requestedRight->method('getType')->willReturn($type); + $requestedRight->method('getCrud')->willReturn($type); $requestedRight->method('getSource')->willReturn($source); $requestedUserRightFacade = new RequestedUserRightFacade($userSourceDirector, $requestedRight); $this->assertEquals($layer, $requestedUserRightFacade->getLayer()); - $this->assertEquals($type, $requestedUserRightFacade->getType()); + $this->assertEquals($type, $requestedUserRightFacade->getCrud()); $this->assertEquals($source, $requestedUserRightFacade->getSource()); $this->assertEquals($reciever, $requestedUserRightFacade->getReciever()); } @@ -66,10 +66,10 @@ class RequestedUserRightFacadeTest extends TestCase $userSourceDirector = new UserSourceDirector($sourceRepository, $user); $requestedUserRightFacade = new RequestedUserRightFacade($userSourceDirector, $requestedRight); $this->assertNull($requestedUserRightFacade->setLayer($layer)); - $this->assertNull($requestedUserRightFacade->setType($type)); + $this->assertNull($requestedUserRightFacade->setCrud($type)); $this->assertNull($requestedUserRightFacade->setRequestedSource($requestedSource)); $this->assertEquals($layer, $requestedRight->getLayer()); - $this->assertEquals($type, $requestedRight->getType()); + $this->assertEquals($type, $requestedRight->getCrud()); $this->expectException(NotSetException::class); $this->assertNotInstanceOf(RequestedSourceInterface::class, $requestedRight->getSource()); } diff --git a/application/symfony/tests/Unit/Domain/ResponseManagement/SourceRESTReponseManagerTest.php b/application/symfony/tests/Unit/Domain/ResponseManagement/SourceRESTReponseManagerTest.php index 362b10a..b95982e 100644 --- a/application/symfony/tests/Unit/Domain/ResponseManagement/SourceRESTReponseManagerTest.php +++ b/application/symfony/tests/Unit/Domain/ResponseManagement/SourceRESTReponseManagerTest.php @@ -67,7 +67,7 @@ class SourceRESTReponseManagerTest extends KernelTestCase $requestedRight->setSource($requestedSource); $requestedRight->setReciever(new PureSource()); $requestedRight->setLayer(LayerType::SOURCE); - $requestedRight->setType(CRUDType::READ); + $requestedRight->setCrud(CRUDType::READ); $this->expectException(AllreadyDefinedException::class); $sourceResponseManager = new SourceRESTResponseManager(null, $this->entityManager, $requestedRight, $this->viewHandler); $sourceResponseManager->getResponse(); diff --git a/application/symfony/tests/Unit/Domain/RightManagement/RightCheckerTest.php b/application/symfony/tests/Unit/Domain/RightManagement/RightCheckerTest.php index 1f13485..ce7e4df 100644 --- a/application/symfony/tests/Unit/Domain/RightManagement/RightCheckerTest.php +++ b/application/symfony/tests/Unit/Domain/RightManagement/RightCheckerTest.php @@ -46,7 +46,7 @@ class RightCheckerTest extends TestCase $this->source = new PureSource(); $this->right = new Right(); $this->right->setReciever($this->source); - $this->right->setType($this->type); + $this->right->setCrud($this->type); $this->right->setLayer($this->layer); $this->rightManager = new RightChecker($this->right); } diff --git a/application/symfony/tests/Unit/Domain/SecureCRUDManagement/CRUD/Read/SecureSourceReadServiceTest.php b/application/symfony/tests/Unit/Domain/SecureCRUDManagement/CRUD/Read/SecureSourceReadServiceTest.php index e7c1cb1..8cd5992 100644 --- a/application/symfony/tests/Unit/Domain/SecureCRUDManagement/CRUD/Read/SecureSourceReadServiceTest.php +++ b/application/symfony/tests/Unit/Domain/SecureCRUDManagement/CRUD/Read/SecureSourceReadServiceTest.php @@ -54,7 +54,7 @@ class SecureSourceReadServiceTest extends KernelTestCase $requestedRight = new Right(); $requestedRight->setSource($requestedSource); $requestedRight->setLayer(LayerType::SOURCE); - $requestedRight->setType(CRUDType::READ); + $requestedRight->setCrud(CRUDType::READ); $requestedRight->setReciever(new UserSource()); $this->expectException(AccessDeniedHttpException::class); $this->secureSourceReadService->read($requestedRight); @@ -67,7 +67,7 @@ class SecureSourceReadServiceTest extends KernelTestCase $requestedRight = new Right(); $requestedRight->setSource($requestedSource); $requestedRight->setLayer(LayerType::SOURCE); - $requestedRight->setType(CRUDType::READ); + $requestedRight->setCrud(CRUDType::READ); $requestedRight->setReciever($this->sourceRepository->findOneBySlug(SystemSlugType::GUEST_USER)); $textSourceResponse = $this->secureSourceReadService->read($requestedRight); $this->assertInstanceOf(TextSourceInterface::class, $textSourceResponse); diff --git a/application/symfony/tests/Unit/Domain/SecureCRUDManagement/Factory/SecureCRUDFactoryServiceTest.php b/application/symfony/tests/Unit/Domain/SecureCRUDManagement/Factory/SecureCRUDFactoryServiceTest.php index 6e7417f..bd2fa6e 100644 --- a/application/symfony/tests/Unit/Domain/SecureCRUDManagement/Factory/SecureCRUDFactoryServiceTest.php +++ b/application/symfony/tests/Unit/Domain/SecureCRUDManagement/Factory/SecureCRUDFactoryServiceTest.php @@ -48,7 +48,7 @@ class SecureCRUDFactoryServiceTest extends KernelTestCase if (!in_array($layer, self::EXCLUDED_TYPES[$crud])) { $requestedRight = new Right(); $requestedRight->setLayer($layer); - $requestedRight->setType($crud); + $requestedRight->setCrud($crud); $secureCreator = $this->secureCRUDFactoryService->create($requestedRight); $this->assertInstanceOf(SecureCRUDServiceInterface::class, $secureCreator); } diff --git a/application/symfony/tests/Unit/Domain/SecureSourceManagement/SecureSourceCheckerTest.php b/application/symfony/tests/Unit/Domain/SecureSourceManagement/SecureSourceCheckerTest.php index fd5ad98..51c7baf 100644 --- a/application/symfony/tests/Unit/Domain/SecureSourceManagement/SecureSourceCheckerTest.php +++ b/application/symfony/tests/Unit/Domain/SecureSourceManagement/SecureSourceCheckerTest.php @@ -52,13 +52,13 @@ class SecureSourceCheckerTest extends TestCase { $right = new Right(); $right->setLayer(LayerType::SOURCE); - $right->setType(CRUDType::UPDATE); + $right->setCrud(CRUDType::UPDATE); $right->setReciever($this->recieverSource); $right->setSource($this->source); $this->source->getLaw()->getRights()->add($right); $requestedRight = clone $right; $this->assertTrue($this->securerSourceChecker->hasPermission($requestedRight)); - $requestedRight->setType(CRUDType::READ); + $requestedRight->setCrud(CRUDType::READ); $this->assertFalse($this->securerSourceChecker->hasPermission($requestedRight)); } @@ -66,7 +66,7 @@ class SecureSourceCheckerTest extends TestCase { $right = new Right(); $right->setLayer(LayerType::SOURCE); - $right->setType(CRUDType::UPDATE); + $right->setCrud(CRUDType::UPDATE); $right->setReciever($this->recieverSource); $right->setSource($this->source); $this->source->getLaw()->getRights()->add($right); @@ -76,7 +76,7 @@ class SecureSourceCheckerTest extends TestCase $this->source->setSource($attributSource); $requestedRight = clone $right; $this->assertTrue($this->securerSourceChecker->hasPermission($requestedRight)); - $childRight->setType(CRUDType::READ); + $childRight->setCrud(CRUDType::READ); $this->expectException(SourceAccessDenied::class); $this->securerSourceChecker->hasPermission($requestedRight); } @@ -85,7 +85,7 @@ class SecureSourceCheckerTest extends TestCase { $right = new Right(); $right->setLayer(LayerType::SOURCE); - $right->setType(CRUDType::UPDATE); + $right->setCrud(CRUDType::UPDATE); $right->setReciever($this->recieverSource); $right->setSource($this->source); $this->source->getLaw()->getRights()->add($right); @@ -98,7 +98,7 @@ class SecureSourceCheckerTest extends TestCase $attribut1Source->setSource($attribut2Source); $requestedRight = clone $right; $this->assertTrue($this->securerSourceChecker->hasPermission($requestedRight)); - $childRight->setType(CRUDType::READ); + $childRight->setCrud(CRUDType::READ); $this->expectException(SourceAccessDenied::class); $this->securerSourceChecker->hasPermission($requestedRight); } diff --git a/application/symfony/tests/Unit/Domain/TemplateManagement/TemplatePathInformationTest.php b/application/symfony/tests/Unit/Domain/TemplateManagement/TemplatePathInformationTest.php index b3fa3fb..0c855b1 100644 --- a/application/symfony/tests/Unit/Domain/TemplateManagement/TemplatePathInformationTest.php +++ b/application/symfony/tests/Unit/Domain/TemplateManagement/TemplatePathInformationTest.php @@ -56,7 +56,7 @@ class TemplatePathInformationTest extends TestCase $this->templateMeta->reloadType($type); $this->assertEquals($this->getExpectedPath($type, 'atom'), $this->templateMeta->getAtomTemplatePath()); $this->assertEquals($this->getExpectedPath($type, 'molecule'), $this->templateMeta->getMoleculeTemplatePath()); - $this->assertEquals($type, $this->templateMeta->getType()); + $this->assertEquals($type, $this->templateMeta->getCrud()); } } } diff --git a/application/symfony/tests/Unit/Entity/Attribut/TypeAttributTest.php b/application/symfony/tests/Unit/Entity/Attribut/TypeAttributTest.php index e8d9751..1b0e8d0 100644 --- a/application/symfony/tests/Unit/Entity/Attribut/TypeAttributTest.php +++ b/application/symfony/tests/Unit/Entity/Attribut/TypeAttributTest.php @@ -3,36 +3,36 @@ namespace Tests\Unit\Entity\Attribut; use PHPUnit\Framework\TestCase; -use App\Entity\Attribut\TypeAttributInterface; -use App\Entity\Attribut\TypeAttribut; +use App\Entity\Attribut\CrudAttributInterface; +use App\Entity\Attribut\CrudAttribut; /** * @author kevinfrantz */ -class TypeAttributTest extends TestCase +class CrudAttributTest extends TestCase { /** - * @var TypeAttributInterface + * @var CrudAttributInterface */ protected $typeAttribut; public function setUp(): void { - $this->typeAttribut = new class() implements TypeAttributInterface { - use TypeAttribut; + $this->typeAttribut = new class() implements CrudAttributInterface { + use CrudAttribut; }; } public function testConstructor(): void { $this->expectException(\TypeError::class); - $this->typeAttribut->getType(); + $this->typeAttribut->getCrud(); } public function testAccessors(): void { $type = 'Hello World!'; - $this->assertNull($this->typeAttribut->setType($type)); - $this->assertEquals($type, $this->typeAttribut->getType()); + $this->assertNull($this->typeAttribut->setCrud($type)); + $this->assertEquals($type, $this->typeAttribut->getCrud()); } } diff --git a/application/symfony/tests/Unit/Entity/Meta/RightTest.php b/application/symfony/tests/Unit/Entity/Meta/RightTest.php index 1b1685f..4e3aa9d 100644 --- a/application/symfony/tests/Unit/Entity/Meta/RightTest.php +++ b/application/symfony/tests/Unit/Entity/Meta/RightTest.php @@ -61,7 +61,7 @@ class RightTest extends TestCase public function testConstructorType(): void { $this->expectException(\TypeError::class); - $this->assertNull($this->right->getType()); + $this->assertNull($this->right->getCrud()); } public function testLaw(): void @@ -74,11 +74,11 @@ class RightTest extends TestCase public function testRight(): void { foreach (CRUDType::getChoices() as $key => $value) { - $this->assertNull($this->right->setType($key)); - $this->assertEquals($key, $this->right->getType()); + $this->assertNull($this->right->setCrud($key)); + $this->assertEquals($key, $this->right->getCrud()); } $this->expectException(NoValidChoiceException::class); - $this->right->setType('NoneValidType'); + $this->right->setCrud('NoneValidType'); } public function testLayer(): void @@ -104,13 +104,13 @@ class RightTest extends TestCase $this->right->setSource($source); $this->right->setReciever($reciever); $this->right->setGrant($grant); - $this->right->setType($type); + $this->right->setCrud($type); $this->right->setLayer($layer); $rightClone = clone $this->right; $this->assertEquals($source, $rightClone->getSource()); $this->assertEquals($reciever, $rightClone->getReciever()); $this->assertEquals($grant, $rightClone->getGrant()); - $this->assertEquals($type, $rightClone->getType()); + $this->assertEquals($type, $rightClone->getCrud()); $this->assertEquals($layer, $rightClone->getLayer()); } } diff --git a/application/symfony/tests/Unit/Repository/Meta/RightRepositoryTest.php b/application/symfony/tests/Unit/Repository/Meta/RightRepositoryTest.php index 48abdf9..913dd56 100644 --- a/application/symfony/tests/Unit/Repository/Meta/RightRepositoryTest.php +++ b/application/symfony/tests/Unit/Repository/Meta/RightRepositoryTest.php @@ -56,7 +56,7 @@ class RightRepositoryTest extends KernelTestCase $this->right = new Right(); $this->right->setPriority(self::PRIORITY); $this->right->setLayer(LayerType::SOURCE); - $this->right->setType(CRUDType::READ); + $this->right->setCrud(CRUDType::READ); $this->law = new Law(); $this->entityManager->persist($this->law); $this->right->setLaw($this->law);