Renamed SecureRequestedRightChecker and implemented integration tests for it

This commit is contained in:
Kevin Frantz
2019-02-16 09:19:49 +01:00
parent 8f0b806719
commit 2aebdd603c
10 changed files with 109 additions and 23 deletions

View File

@@ -4,6 +4,9 @@ namespace App\Domain\ActionManagement;
use App\Entity\EntityInterface;
/**
* @author kevinfrantz
*/
interface ActionInterface
{
/**

View File

@@ -11,7 +11,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\EntityManagerInterface;
use App\Domain\FormManagement\RequestedActionFormBuilderServiceInterface;
use App\Domain\RequestManagement\Action\RequestedActionServiceInterface;
use App\Domain\SecureManagement\SecureRequestedRightCheckerInterface;
use App\Domain\SecureManagement\SecureRequestedRightCheckerServiceInterface;
/**
* @author kevinfrantz
@@ -29,9 +29,9 @@ final class ActionService implements ActionServiceInterface
private $requestedAction;
/**
* @var SecureRequestedRightCheckerInterface
* @var SecureRequestedRightCheckerServiceInterface
*/
private $secureRequestedRightChecker;
private $secureRequestedRightCheckerService;
/**
* @var LayerRepositoryFactoryServiceInterface
@@ -51,10 +51,10 @@ final class ActionService implements ActionServiceInterface
/**
* @param RequestedActionInterface $requestedActionService
*/
public function __construct(RequestedActionServiceInterface $requestedActionService, SecureRequestedRightCheckerInterface $secureRequestedRightChecker, RequestStack $requestStack, LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService, RequestedActionFormBuilderServiceInterface $requestedActionFormBuilderService, EntityManagerInterface $entityManager)
public function __construct(RequestedActionServiceInterface $requestedActionService, SecureRequestedRightCheckerServiceInterface $secureRequestedRightChecker, RequestStack $requestStack, LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService, RequestedActionFormBuilderServiceInterface $requestedActionFormBuilderService, EntityManagerInterface $entityManager)
{
$this->requestedAction = $requestedActionService;
$this->secureRequestedRightChecker = $secureRequestedRightChecker;
$this->secureRequestedRightCheckerService = $secureRequestedRightChecker;
$this->requestStack = $requestStack;
$this->layerRepositoryFactoryService = $layerRepositoryFactoryService;
$this->requestedActionFormBuilderService = $requestedActionFormBuilderService;
@@ -78,7 +78,7 @@ final class ActionService implements ActionServiceInterface
*/
public function isRequestedActionSecure(): bool
{
return $this->secureRequestedRightChecker->check($this->requestedAction);
return $this->secureRequestedRightCheckerService->check($this->requestedAction);
}
/**

View File

@@ -9,7 +9,7 @@ use App\Domain\RightManagement\RightTransformerServiceInterface;
/**
* @author kevinfrantz
*/
final class SecureRequestedRightChecker implements SecureRequestedRightCheckerInterface
final class SecureRequestedRightCheckerService implements SecureRequestedRightCheckerServiceInterface
{
/**
* @var RightTransformerServiceInterface
@@ -27,7 +27,7 @@ final class SecureRequestedRightChecker implements SecureRequestedRightCheckerIn
/**
* {@inheritdoc}
*
* @see \App\Domain\SecureManagement\SecureRequestedRightCheckerInterface::check()
* @see \App\Domain\SecureManagement\SecureRequestedRightCheckerServiceInterface::check()
*/
public function check(RequestedRightInterface $requestedRight): bool
{

View File

@@ -9,7 +9,7 @@ use App\Domain\RequestManagement\Right\RequestedRightInterface;
*
* @author kevinfrantz
*/
interface SecureRequestedRightCheckerInterface
interface SecureRequestedRightCheckerServiceInterface
{
/**
* @param RequestedRightInterface $requestedRight