mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-04-16 10:16:22 +02:00
Injected requestedAction as Service
This commit is contained in:
parent
54b0d98ef3
commit
6563a9fb5a
@ -3,7 +3,6 @@
|
|||||||
namespace App\Domain\ActionManagement;
|
namespace App\Domain\ActionManagement;
|
||||||
|
|
||||||
use App\Domain\RequestManagement\Action\RequestedActionInterface;
|
use App\Domain\RequestManagement\Action\RequestedActionInterface;
|
||||||
use App\Domain\SecureManagement\SecureRequestedRightCheckerInterface;
|
|
||||||
use App\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
|
use App\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\RequestStack;
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
@ -11,6 +10,8 @@ use App\Repository\RepositoryInterface;
|
|||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use App\Domain\FormManagement\RequestedActionFormBuilderServiceInterface;
|
use App\Domain\FormManagement\RequestedActionFormBuilderServiceInterface;
|
||||||
|
use App\Domain\RequestManagement\Action\RequestedActionServiceInterface;
|
||||||
|
use App\Domain\SecureManagement\SecureRequestedRightCheckerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kevinfrantz
|
* @author kevinfrantz
|
||||||
@ -48,11 +49,11 @@ final class ActionService implements ActionServiceInterface
|
|||||||
private $entityManager;
|
private $entityManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param RequestedActionInterface $requestedAction
|
* @param RequestedActionInterface $requestedActionService
|
||||||
*/
|
*/
|
||||||
public function __construct(RequestedActionInterface $requestedAction, SecureRequestedRightCheckerInterface $secureRequestedRightChecker, RequestStack $requestStack, LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService, RequestedActionFormBuilderServiceInterface $requestedActionFormBuilderService, EntityManagerInterface $entityManager)
|
public function __construct(RequestedActionServiceInterface $requestedActionService, SecureRequestedRightCheckerInterface $secureRequestedRightChecker, RequestStack $requestStack, LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService, RequestedActionFormBuilderServiceInterface $requestedActionFormBuilderService, EntityManagerInterface $entityManager)
|
||||||
{
|
{
|
||||||
$this->requestedAction = $requestedAction;
|
$this->requestedAction = $requestedActionService;
|
||||||
$this->secureRequestedRightChecker = $secureRequestedRightChecker;
|
$this->secureRequestedRightChecker = $secureRequestedRightChecker;
|
||||||
$this->requestStack = $requestStack;
|
$this->requestStack = $requestStack;
|
||||||
$this->layerRepositoryFactoryService = $layerRepositoryFactoryService;
|
$this->layerRepositoryFactoryService = $layerRepositoryFactoryService;
|
||||||
|
@ -17,6 +17,7 @@ use PHPUnit\Framework\MockObject\MockObject;
|
|||||||
use App\Entity\EntityInterface;
|
use App\Entity\EntityInterface;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use App\Domain\FormManagement\RequestedActionFormBuilderServiceInterface;
|
use App\Domain\FormManagement\RequestedActionFormBuilderServiceInterface;
|
||||||
|
use App\Domain\RequestManagement\Action\RequestedActionServiceInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kevinfrantz
|
* @author kevinfrantz
|
||||||
@ -24,9 +25,9 @@ use App\Domain\FormManagement\RequestedActionFormBuilderServiceInterface;
|
|||||||
class ActionServiceTest extends TestCase
|
class ActionServiceTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var RequestedActionInterface|MockObject
|
* @var RequestedActionServiceInterface|MockObject
|
||||||
*/
|
*/
|
||||||
private $requestedAction;
|
private $requestedActionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var SecureRequestedRightCheckerInterface|MockObject
|
* @var SecureRequestedRightCheckerInterface|MockObject
|
||||||
@ -75,15 +76,15 @@ class ActionServiceTest extends TestCase
|
|||||||
$this->requestedEntity = $this->createMock(RequestedEntityInterface::class);
|
$this->requestedEntity = $this->createMock(RequestedEntityInterface::class);
|
||||||
$this->requestedEntity->method('getEntity')->willReturn($this->entity);
|
$this->requestedEntity->method('getEntity')->willReturn($this->entity);
|
||||||
|
|
||||||
$this->requestedAction = $this->createMock(RequestedActionInterface::class);
|
$this->requestedActionService = $this->createMock(RequestedActionServiceInterface::class);
|
||||||
$this->requestedAction->method('getRequestedEntity')->willReturn($this->requestedEntity);
|
$this->requestedActionService->method('getRequestedEntity')->willReturn($this->requestedEntity);
|
||||||
|
|
||||||
$this->secureRequestedRightChecker = $this->createMock(SecureRequestedRightCheckerInterface::class);
|
$this->secureRequestedRightChecker = $this->createMock(SecureRequestedRightCheckerInterface::class);
|
||||||
$this->requestedActionFormBuilderService = $this->createMock(RequestedActionFormBuilderServiceInterface::class);
|
$this->requestedActionFormBuilderService = $this->createMock(RequestedActionFormBuilderServiceInterface::class);
|
||||||
$this->requestStack = $this->createMock(RequestStack::class);
|
$this->requestStack = $this->createMock(RequestStack::class);
|
||||||
$this->layerRepositoryFactoryService = $this->createMock(LayerRepositoryFactoryServiceInterface::class);
|
$this->layerRepositoryFactoryService = $this->createMock(LayerRepositoryFactoryServiceInterface::class);
|
||||||
$this->entityManager = $this->createMock(EntityManagerInterface::class);
|
$this->entityManager = $this->createMock(EntityManagerInterface::class);
|
||||||
$this->actionService = new ActionService($this->requestedAction, $this->secureRequestedRightChecker, $this->requestStack, $this->layerRepositoryFactoryService, $this->requestedActionFormBuilderService, $this->entityManager);
|
$this->actionService = new ActionService($this->requestedActionService, $this->secureRequestedRightChecker, $this->requestStack, $this->layerRepositoryFactoryService, $this->requestedActionFormBuilderService, $this->entityManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testIsRequestedActionSecure(): void
|
public function testIsRequestedActionSecure(): void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user