Updated type references

This commit is contained in:
Kevin Frantz 2019-01-05 17:27:40 +01:00
parent d1676fea7c
commit 7300f059c3
15 changed files with 53 additions and 53 deletions

View File

@ -16,8 +16,8 @@ doctrine:
collate: utf8mb4_unicode_ci collate: utf8mb4_unicode_ci
url: '%env(resolve:DATABASE_URL)%' url: '%env(resolve:DATABASE_URL)%'
types: types:
RightType: App\DBAL\Types\RightType CRUDType: App\DBAL\Types\Meta\Right\CRUDType
LayerType: App\DBAL\Types\LayerType LayerType: App\DBAL\Types\Meta\Right\LayerType
orm: orm:
auto_generate_proxy_classes: '%kernel.debug%' auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore naming_strategy: doctrine.orm.naming_strategy.underscore

View File

@ -7,8 +7,8 @@ use Symfony\Component\HttpFoundation\Response;
use App\DBAL\Types\SystemSlugType; use App\DBAL\Types\SystemSlugType;
use App\Entity\Source\AbstractSource; use App\Entity\Source\AbstractSource;
use App\Entity\Meta\Right; use App\Entity\Meta\Right;
use App\DBAL\Types\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
use App\DBAL\Types\RightType; use App\DBAL\Types\Meta\Right\CRUDType;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use App\Entity\Source\PureSource; use App\Entity\Source\PureSource;
use App\Domain\ResponseManagement\SourceRESTResponseManager; use App\Domain\ResponseManagement\SourceRESTResponseManager;
@ -31,7 +31,7 @@ final class DefaultController extends AbstractEntityController
$requestedRight = new Right(); $requestedRight = new Right();
$requestedRight->setSource($requestedSource); $requestedRight->setSource($requestedSource);
$requestedRight->setLayer(LayerType::SOURCE); $requestedRight->setLayer(LayerType::SOURCE);
$requestedRight->setType(RightType::READ); $requestedRight->setType(CRUDType::READ);
$sourceResponseManager = new SourceRESTResponseManager($this->getUser(), $entityManager, $requestedRight, $this->getViewHandler()); $sourceResponseManager = new SourceRESTResponseManager($this->getUser(), $entityManager, $requestedRight, $this->getViewHandler());
return $sourceResponseManager->getResponse(); return $sourceResponseManager->getResponse();

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\DBAL\Types\Meta; namespace App\DBAL\Types\Meta\Right;
use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType; use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;

View File

@ -10,8 +10,8 @@ use App\DBAL\Types\SystemSlugType;
use App\Entity\Source\Complex\UserSource; use App\Entity\Source\Complex\UserSource;
use App\Entity\Source\Complex\UserSourceInterface; use App\Entity\Source\Complex\UserSourceInterface;
use App\Entity\Meta\Right; use App\Entity\Meta\Right;
use App\DBAL\Types\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
use App\DBAL\Types\RightType; use App\DBAL\Types\Meta\Right\CRUDType;
use App\Entity\Meta\RightInterface; use App\Entity\Meta\RightInterface;
use App\Domain\SourceManagement\SourceRightManager; use App\Domain\SourceManagement\SourceRightManager;
@ -65,7 +65,7 @@ class SourceFixtures extends Fixture
$sourceRightManager = new SourceRightManager($this->impressumSource); $sourceRightManager = new SourceRightManager($this->impressumSource);
$sourceRightManager->addRight($right); $sourceRightManager->addRight($right);
$right->setLayer(LayerType::SOURCE); $right->setLayer(LayerType::SOURCE);
$right->setType(RightType::READ); $right->setType(CRUDType::READ);
$right->setReciever($this->guestUserSource); $right->setReciever($this->guestUserSource);
return $right; return $right;

View File

@ -2,7 +2,7 @@
namespace App\Domain\TemplateManagement; namespace App\Domain\TemplateManagement;
use App\DBAL\Types\TemplateType; use App\DBAL\Types\RESTResponseType;
/** /**
* @author kevinfrantz * @author kevinfrantz
@ -22,7 +22,7 @@ final class TemplateMeta implements TemplateMetaInterface
/** /**
* @var string * @var string
*/ */
private $type = TemplateType::HTML; private $type = RESTResponseType::HTML;
/** /**
* @var string * @var string

View File

@ -6,8 +6,7 @@ use App\Entity\Attribut\TypeAttribut;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Fresh\DoctrineEnumBundle\Validator\Constraints as DoctrineAssert; use Fresh\DoctrineEnumBundle\Validator\Constraints as DoctrineAssert;
use App\Entity\Attribut\LawAttribut; use App\Entity\Attribut\LawAttribut;
use App\DBAL\Types\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
use App\DBAL\Types\RightType;
use App\Entity\Attribut\GrantAttribut; use App\Entity\Attribut\GrantAttribut;
use App\Logic\Operation\OperationInterface; use App\Logic\Operation\OperationInterface;
use App\Entity\Attribut\ConditionAttribut; use App\Entity\Attribut\ConditionAttribut;
@ -17,6 +16,7 @@ use App\Entity\Attribut\RelationAttribut;
use App\Entity\Attribut\PriorityAttribut; use App\Entity\Attribut\PriorityAttribut;
use App\Entity\Source\SourceInterface; use App\Entity\Source\SourceInterface;
use App\Exception\NoValidChoiceException; use App\Exception\NoValidChoiceException;
use App\DBAL\Types\Meta\Right\CRUDType;
/** /**
* @author kevinfrantz * @author kevinfrantz
@ -52,7 +52,7 @@ class Right extends AbstractMeta implements RightInterface
/** /**
* @ORM\Column(name="layer", type="LayerType", nullable=false) * @ORM\Column(name="layer", type="LayerType", nullable=false)
* @DoctrineAssert\Enum(entity="App\DBAL\Types\LayerType") * @DoctrineAssert\Enum(entity="App\DBAL\Types\Meta\Right\LayerType")
* *
* @var string * @var string
*/ */
@ -75,8 +75,8 @@ class Right extends AbstractMeta implements RightInterface
protected $grant; protected $grant;
/** /**
* @ORM\Column(name="type", type="RightType", nullable=false) * @ORM\Column(name="type", type="CRUDType", nullable=false)
* @DoctrineAssert\Enum(entity="App\DBAL\Types\RightType") * @DoctrineAssert\Enum(entity="App\DBAL\Types\Meta\Right\CRUDType")
* *
* @var string * @var string
*/ */
@ -99,7 +99,7 @@ class Right extends AbstractMeta implements RightInterface
public function setType(string $type): void public function setType(string $type): void
{ {
if (!array_key_exists($type, RightType::getChoices())) { if (!array_key_exists($type, CRUDType::getChoices())) {
throw new NoValidChoiceException(); throw new NoValidChoiceException();
} }
$this->type = $type; $this->type = $type;

View File

@ -5,7 +5,7 @@ namespace Tests\Integration\Controller\API;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\BrowserKit\Request; use Symfony\Component\BrowserKit\Request;
use App\DBAL\Types\LanguageType; use App\DBAL\Types\LanguageType;
use App\DBAL\Types\Meta\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
use App\DBAL\Types\RESTResponseType; use App\DBAL\Types\RESTResponseType;
/** /**

View File

@ -7,8 +7,8 @@ use App\Domain\LawManagement\LawPermissionCheckerService;
use App\Domain\LawManagement\LawPermissionCheckerServiceInterface; use App\Domain\LawManagement\LawPermissionCheckerServiceInterface;
use App\Entity\Source\SourceInterface; use App\Entity\Source\SourceInterface;
use App\Entity\Meta\Right; use App\Entity\Meta\Right;
use App\DBAL\Types\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
use App\DBAL\Types\RightType; use App\DBAL\Types\Meta\Right\CRUDType;
use App\Entity\Meta\Law; use App\Entity\Meta\Law;
use App\Entity\Meta\LawInterface; use App\Entity\Meta\LawInterface;
use App\Entity\Meta\RightInterface; use App\Entity\Meta\RightInterface;
@ -87,7 +87,7 @@ class LawPermissionCheckerTest extends TestCase
{ {
$this->clientRight = new Right(); $this->clientRight = new Right();
$this->clientRight->setLayer(LayerType::SOURCE); $this->clientRight->setLayer(LayerType::SOURCE);
$this->clientRight->setType(RightType::READ); $this->clientRight->setType(CRUDType::READ);
$this->clientRight->setReciever($this->clientSource); $this->clientRight->setReciever($this->clientSource);
$this->clientRight->setSource($this->source); $this->clientRight->setSource($this->source);
} }
@ -107,7 +107,7 @@ class LawPermissionCheckerTest extends TestCase
{ {
$this->law->getRights()->add($this->getClonedClientRight()); $this->law->getRights()->add($this->getClonedClientRight());
$this->assertTrue($this->checkClientPermission()); $this->assertTrue($this->checkClientPermission());
$this->clientRight->setType(RightType::WRITE); $this->clientRight->setType(CRUDType::UPDATE);
$this->assertFalse($this->checkClientPermission()); $this->assertFalse($this->checkClientPermission());
} }
@ -142,10 +142,10 @@ class LawPermissionCheckerTest extends TestCase
public function testGetRightsByType(): void public function testGetRightsByType(): void
{ {
$right = $this->getClonedClientRight(); $right = $this->getClonedClientRight();
$right->setType(RightType::WRITE); $right->setType(CRUDType::UPDATE);
$this->law->getRights()->add($right); $this->law->getRights()->add($right);
$this->assertFalse($this->checkClientPermission()); $this->assertFalse($this->checkClientPermission());
$right->setType(RightType::READ); $right->setType(CRUDType::READ);
$this->assertTrue($this->checkClientPermission()); $this->assertTrue($this->checkClientPermission());
} }

View File

@ -9,8 +9,8 @@ use App\Entity\Meta\Right;
use FOS\RestBundle\View\ViewHandlerInterface; use FOS\RestBundle\View\ViewHandlerInterface;
use App\Entity\Source\PureSource; use App\Entity\Source\PureSource;
use App\DBAL\Types\SystemSlugType; use App\DBAL\Types\SystemSlugType;
use App\DBAL\Types\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
use App\DBAL\Types\RightType; use App\DBAL\Types\Meta\Right\CRUDType;
use App\Domain\ResponseManagement\SourceRESTResponseManager; use App\Domain\ResponseManagement\SourceRESTResponseManager;
use App\Exception\AllreadyDefinedException; use App\Exception\AllreadyDefinedException;
@ -67,7 +67,7 @@ class SourceRESTReponseManagerTest extends KernelTestCase
$requestedRight->setSource($requestedSource); $requestedRight->setSource($requestedSource);
$requestedRight->setReciever(new PureSource()); $requestedRight->setReciever(new PureSource());
$requestedRight->setLayer(LayerType::SOURCE); $requestedRight->setLayer(LayerType::SOURCE);
$requestedRight->setType(RightType::READ); $requestedRight->setType(CRUDType::READ);
$this->expectException(AllreadyDefinedException::class); $this->expectException(AllreadyDefinedException::class);
$sourceResponseManager = new SourceRESTResponseManager(null, $this->entityManager, $requestedRight, $this->viewHandler); $sourceResponseManager = new SourceRESTResponseManager(null, $this->entityManager, $requestedRight, $this->viewHandler);
$sourceResponseManager->getResponse(); $sourceResponseManager->getResponse();

View File

@ -6,10 +6,10 @@ use PHPUnit\Framework\TestCase;
use App\Entity\Meta\RightInterface; use App\Entity\Meta\RightInterface;
use App\Entity\Meta\Right; use App\Entity\Meta\Right;
use App\Entity\Source\SourceInterface; use App\Entity\Source\SourceInterface;
use App\DBAL\Types\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
use App\Domain\RightManagement\RightCheckerInterface; use App\Domain\RightManagement\RightCheckerInterface;
use App\Domain\RightManagement\RightChecker; use App\Domain\RightManagement\RightChecker;
use App\DBAL\Types\RightType; use App\DBAL\Types\Meta\Right\CRUDType;
use App\Entity\Source\PureSource; use App\Entity\Source\PureSource;
class RightCheckerTest extends TestCase class RightCheckerTest extends TestCase
@ -42,7 +42,7 @@ class RightCheckerTest extends TestCase
public function setUp(): void public function setUp(): void
{ {
$this->layer = LayerType::RELATION; $this->layer = LayerType::RELATION;
$this->type = RightType::READ; $this->type = CRUDType::READ;
$this->source = new PureSource(); $this->source = new PureSource();
$this->right = new Right(); $this->right = new Right();
$this->right->setReciever($this->source); $this->right->setReciever($this->source);
@ -57,7 +57,7 @@ class RightCheckerTest extends TestCase
$this->assertTrue($granted); $this->assertTrue($granted);
$notGranted = $this->rightManager->isGranted(LayerType::SOURCE, $this->type, $this->source); $notGranted = $this->rightManager->isGranted(LayerType::SOURCE, $this->type, $this->source);
$this->assertFalse($notGranted); $this->assertFalse($notGranted);
$notGranted2 = $this->rightManager->isGranted($this->layer, RightType::WRITE, $this->source); $notGranted2 = $this->rightManager->isGranted($this->layer, CRUDType::UPDATE, $this->source);
$this->assertFalse($notGranted2); $this->assertFalse($notGranted2);
$this->right->setGrant(false); $this->right->setGrant(false);
$notGranted3 = $this->rightManager->isGranted($this->layer, $this->type, $this->source); $notGranted3 = $this->rightManager->isGranted($this->layer, $this->type, $this->source);
@ -74,7 +74,7 @@ class RightCheckerTest extends TestCase
$this->assertTrue($granted); $this->assertTrue($granted);
$notGranted = $this->rightManager->isGranted(LayerType::SOURCE, $this->type, $secondSource); $notGranted = $this->rightManager->isGranted(LayerType::SOURCE, $this->type, $secondSource);
$this->assertFalse($notGranted); $this->assertFalse($notGranted);
$notGranted2 = $this->rightManager->isGranted($this->layer, RightType::WRITE, $secondSource); $notGranted2 = $this->rightManager->isGranted($this->layer, CRUDType::UPDATE, $secondSource);
$this->assertFalse($notGranted2); $this->assertFalse($notGranted2);
$this->right->setGrant(false); $this->right->setGrant(false);
$notGranted3 = $this->rightManager->isGranted($this->layer, $this->type, $secondSource); $notGranted3 = $this->rightManager->isGranted($this->layer, $this->type, $secondSource);
@ -91,7 +91,7 @@ class RightCheckerTest extends TestCase
$this->assertTrue($granted); $this->assertTrue($granted);
$notGranted = $this->rightManager->isGranted(LayerType::SOURCE, $this->type, $thirdSource); $notGranted = $this->rightManager->isGranted(LayerType::SOURCE, $this->type, $thirdSource);
$this->assertFalse($notGranted); $this->assertFalse($notGranted);
$notGranted2 = $this->rightManager->isGranted($this->layer, RightType::WRITE, $thirdSource); $notGranted2 = $this->rightManager->isGranted($this->layer, CRUDType::UPDATE, $thirdSource);
$this->assertFalse($notGranted2); $this->assertFalse($notGranted2);
$this->right->setGrant(false); $this->right->setGrant(false);
$notGranted3 = $this->rightManager->isGranted($this->layer, $this->type, $thirdSource); $notGranted3 = $this->rightManager->isGranted($this->layer, $this->type, $thirdSource);

View File

@ -10,8 +10,8 @@ use App\Domain\SecureLoadManagement\SecureSourceLoader;
use App\Entity\Source\Primitive\Text\TextSource; use App\Entity\Source\Primitive\Text\TextSource;
use App\DBAL\Types\SystemSlugType; use App\DBAL\Types\SystemSlugType;
use App\Entity\Meta\Right; use App\Entity\Meta\Right;
use App\DBAL\Types\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
use App\DBAL\Types\RightType; use App\DBAL\Types\Meta\Right\CRUDType;
use App\Entity\Source\Complex\UserSource; use App\Entity\Source\Complex\UserSource;
use App\Entity\Source\Primitive\Text\TextSourceInterface; use App\Entity\Source\Primitive\Text\TextSourceInterface;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@ -52,7 +52,7 @@ class SecureSourceLoaderTest extends KernelTestCase
$requestedRight = new Right(); $requestedRight = new Right();
$requestedRight->setSource($requestedSource); $requestedRight->setSource($requestedSource);
$requestedRight->setLayer(LayerType::SOURCE); $requestedRight->setLayer(LayerType::SOURCE);
$requestedRight->setType(RightType::READ); $requestedRight->setType(CRUDType::READ);
$requestedRight->setReciever(new UserSource()); $requestedRight->setReciever(new UserSource());
$secureSourceLoader = new SecureSourceLoader($this->entityManager, $requestedRight); $secureSourceLoader = new SecureSourceLoader($this->entityManager, $requestedRight);
$this->expectException(AccessDeniedHttpException::class); $this->expectException(AccessDeniedHttpException::class);
@ -66,7 +66,7 @@ class SecureSourceLoaderTest extends KernelTestCase
$requestedRight = new Right(); $requestedRight = new Right();
$requestedRight->setSource($requestedSource); $requestedRight->setSource($requestedSource);
$requestedRight->setLayer(LayerType::SOURCE); $requestedRight->setLayer(LayerType::SOURCE);
$requestedRight->setType(RightType::READ); $requestedRight->setType(CRUDType::READ);
$requestedRight->setReciever($this->sourceRepository->findOneBySlug(SystemSlugType::GUEST_USER)); $requestedRight->setReciever($this->sourceRepository->findOneBySlug(SystemSlugType::GUEST_USER));
$secureSourceLoader = new SecureSourceLoader($this->entityManager, $requestedRight); $secureSourceLoader = new SecureSourceLoader($this->entityManager, $requestedRight);
$this->assertInstanceOf(TextSourceInterface::class, $secureSourceLoader->getSource()); $this->assertInstanceOf(TextSourceInterface::class, $secureSourceLoader->getSource());

View File

@ -8,8 +8,8 @@ use App\Domain\SecureManagement\SecureSourceCheckerInterface;
use App\Entity\Source\AbstractSource; use App\Entity\Source\AbstractSource;
use App\Domain\SecureManagement\SecureSourceChecker; use App\Domain\SecureManagement\SecureSourceChecker;
use App\Entity\Meta\Right; use App\Entity\Meta\Right;
use App\DBAL\Types\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
use App\DBAL\Types\RightType; use App\DBAL\Types\Meta\Right\CRUDType;
use App\Entity\Attribut\SourceAttribut; use App\Entity\Attribut\SourceAttribut;
use App\Entity\Attribut\SourceAttributInterface; use App\Entity\Attribut\SourceAttributInterface;
use App\Exception\SourceAccessDenied; use App\Exception\SourceAccessDenied;
@ -52,13 +52,13 @@ class SecureSourceCheckerTest extends TestCase
{ {
$right = new Right(); $right = new Right();
$right->setLayer(LayerType::SOURCE); $right->setLayer(LayerType::SOURCE);
$right->setType(RightType::WRITE); $right->setType(CRUDType::UPDATE);
$right->setReciever($this->recieverSource); $right->setReciever($this->recieverSource);
$right->setSource($this->source); $right->setSource($this->source);
$this->source->getLaw()->getRights()->add($right); $this->source->getLaw()->getRights()->add($right);
$requestedRight = clone $right; $requestedRight = clone $right;
$this->assertTrue($this->securerSourceChecker->hasPermission($requestedRight)); $this->assertTrue($this->securerSourceChecker->hasPermission($requestedRight));
$requestedRight->setType(RightType::READ); $requestedRight->setType(CRUDType::READ);
$this->assertFalse($this->securerSourceChecker->hasPermission($requestedRight)); $this->assertFalse($this->securerSourceChecker->hasPermission($requestedRight));
} }
@ -66,7 +66,7 @@ class SecureSourceCheckerTest extends TestCase
{ {
$right = new Right(); $right = new Right();
$right->setLayer(LayerType::SOURCE); $right->setLayer(LayerType::SOURCE);
$right->setType(RightType::WRITE); $right->setType(CRUDType::UPDATE);
$right->setReciever($this->recieverSource); $right->setReciever($this->recieverSource);
$right->setSource($this->source); $right->setSource($this->source);
$this->source->getLaw()->getRights()->add($right); $this->source->getLaw()->getRights()->add($right);
@ -76,7 +76,7 @@ class SecureSourceCheckerTest extends TestCase
$this->source->setSource($attributSource); $this->source->setSource($attributSource);
$requestedRight = clone $right; $requestedRight = clone $right;
$this->assertTrue($this->securerSourceChecker->hasPermission($requestedRight)); $this->assertTrue($this->securerSourceChecker->hasPermission($requestedRight));
$childRight->setType(RightType::READ); $childRight->setType(CRUDType::READ);
$this->expectException(SourceAccessDenied::class); $this->expectException(SourceAccessDenied::class);
$this->securerSourceChecker->hasPermission($requestedRight); $this->securerSourceChecker->hasPermission($requestedRight);
} }
@ -85,7 +85,7 @@ class SecureSourceCheckerTest extends TestCase
{ {
$right = new Right(); $right = new Right();
$right->setLayer(LayerType::SOURCE); $right->setLayer(LayerType::SOURCE);
$right->setType(RightType::WRITE); $right->setType(CRUDType::UPDATE);
$right->setReciever($this->recieverSource); $right->setReciever($this->recieverSource);
$right->setSource($this->source); $right->setSource($this->source);
$this->source->getLaw()->getRights()->add($right); $this->source->getLaw()->getRights()->add($right);
@ -98,7 +98,7 @@ class SecureSourceCheckerTest extends TestCase
$attribut1Source->setSource($attribut2Source); $attribut1Source->setSource($attribut2Source);
$requestedRight = clone $right; $requestedRight = clone $right;
$this->assertTrue($this->securerSourceChecker->hasPermission($requestedRight)); $this->assertTrue($this->securerSourceChecker->hasPermission($requestedRight));
$childRight->setType(RightType::READ); $childRight->setType(CRUDType::READ);
$this->expectException(SourceAccessDenied::class); $this->expectException(SourceAccessDenied::class);
$this->securerSourceChecker->hasPermission($requestedRight); $this->securerSourceChecker->hasPermission($requestedRight);
} }

View File

@ -5,7 +5,7 @@ namespace Tests\Unit\Entity\Attribut;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use App\Entity\Attribut\LayerAttributInterface; use App\Entity\Attribut\LayerAttributInterface;
use App\Entity\Attribut\LayerAttribut; use App\Entity\Attribut\LayerAttribut;
use App\DBAL\Types\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
class LayerAttributTest extends TestCase class LayerAttributTest extends TestCase
{ {

View File

@ -3,11 +3,11 @@
namespace tests\unit\Entity; namespace tests\unit\Entity;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use App\DBAL\Types\RightType; use App\DBAL\Types\Meta\Right\CRUDType;
use App\Entity\Meta\RightInterface; use App\Entity\Meta\RightInterface;
use App\Entity\Meta\Right; use App\Entity\Meta\Right;
use App\Entity\Meta\Law; use App\Entity\Meta\Law;
use App\DBAL\Types\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
use App\Exception\NoValidChoiceException; use App\Exception\NoValidChoiceException;
use App\Entity\Source\AbstractSource; use App\Entity\Source\AbstractSource;
@ -73,7 +73,7 @@ class RightTest extends TestCase
public function testRight(): void public function testRight(): void
{ {
foreach (RightType::getChoices() as $key => $value) { foreach (CRUDType::getChoices() as $key => $value) {
$this->assertNull($this->right->setType($key)); $this->assertNull($this->right->setType($key));
$this->assertEquals($key, $this->right->getType()); $this->assertEquals($key, $this->right->getType());
} }
@ -99,7 +99,7 @@ class RightTest extends TestCase
$source = $this->createMock(AbstractSource::class); $source = $this->createMock(AbstractSource::class);
$reciever = $this->createMock(AbstractSource::class); $reciever = $this->createMock(AbstractSource::class);
$grant = false; $grant = false;
$type = RightType::READ; $type = CRUDType::READ;
$layer = LayerType::SOURCE; $layer = LayerType::SOURCE;
$this->right->setSource($source); $this->right->setSource($source);
$this->right->setReciever($reciever); $this->right->setReciever($reciever);

View File

@ -6,8 +6,8 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
use App\Entity\Meta\RightInterface; use App\Entity\Meta\RightInterface;
use App\Entity\Meta\Right; use App\Entity\Meta\Right;
use App\DBAL\Types\LayerType; use App\DBAL\Types\Meta\Right\LayerType;
use App\DBAL\Types\RightType; use App\DBAL\Types\Meta\Right\CRUDType;
use App\Entity\Meta\Law; use App\Entity\Meta\Law;
use App\Entity\Meta\LawInterface; use App\Entity\Meta\LawInterface;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@ -56,7 +56,7 @@ class RightRepositoryTest extends KernelTestCase
$this->right = new Right(); $this->right = new Right();
$this->right->setPriority(self::PRIORITY); $this->right->setPriority(self::PRIORITY);
$this->right->setLayer(LayerType::SOURCE); $this->right->setLayer(LayerType::SOURCE);
$this->right->setType(RightType::READ); $this->right->setType(CRUDType::READ);
$this->law = new Law(); $this->law = new Law();
$this->entityManager->persist($this->law); $this->entityManager->persist($this->law);
$this->right->setLaw($this->law); $this->right->setLaw($this->law);