mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Refactored ActionManagement
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace tests\Integration\Domain\ActionManagement;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Infinito\Domain\ActionManagement\ActionServiceInterface;
|
||||
use Infinito\Domain\ActionManagement\ActionDAOServiceInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
/**
|
||||
@@ -12,7 +12,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
class ActionServiceIntegrationTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var ActionServiceInterface
|
||||
* @var ActionDAOServiceInterface
|
||||
*/
|
||||
private $actionService;
|
||||
|
||||
@@ -24,10 +24,10 @@ class ActionServiceIntegrationTest extends KernelTestCase
|
||||
public function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->actionService = self::$container->get(ActionServiceInterface::class);
|
||||
$this->actionService = self::$container->get(ActionDAOServiceInterface::class);
|
||||
}
|
||||
|
||||
public function testEnityManager(): void
|
||||
public function testEntityManager(): void
|
||||
{
|
||||
$this->assertInstanceOf(EntityManagerInterface::class, $this->actionService->getEntityManager());
|
||||
}
|
||||
|
@@ -3,9 +3,9 @@
|
||||
namespace Tests\Integration\Domain\ActionManagement\Create;
|
||||
|
||||
use Infinito\Domain\ActionManagement\Create\CreateSourceAction;
|
||||
use Infinito\Domain\ActionManagement\ActionService;
|
||||
use Infinito\Domain\ActionManagement\ActionDAOService;
|
||||
use Infinito\Domain\ActionManagement\Create\CreateActionInterface;
|
||||
use Infinito\Domain\ActionManagement\ActionServiceInterface;
|
||||
use Infinito\Domain\ActionManagement\ActionDAOServiceInterface;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Infinito\Entity\Source\PureSourceInterface;
|
||||
use Infinito\Domain\RequestManagement\Action\RequestedActionService;
|
||||
@@ -39,7 +39,7 @@ class CreateSourceActionIntegrationTest extends KernelTestCase
|
||||
private $createSourceAction;
|
||||
|
||||
/**
|
||||
* @var ActionServiceInterface
|
||||
* @var ActionDAOServiceInterface
|
||||
*/
|
||||
private $actionService;
|
||||
|
||||
@@ -80,7 +80,7 @@ class CreateSourceActionIntegrationTest extends KernelTestCase
|
||||
$layerRepositoryFactoryService = new LayerRepositoryFactoryService($entityManager);
|
||||
$rightTransformerService = new RightTransformerService();
|
||||
$secureRequestedRightChecker = new SecureRequestedRightCheckerService($rightTransformerService);
|
||||
$this->actionService = new ActionService($this->requestedActionService, $secureRequestedRightChecker, $this->requestStack, $layerRepositoryFactoryService, $entityFormBuilderService, $entityManager);
|
||||
$this->actionService = new ActionDAOService($this->requestedActionService, $secureRequestedRightChecker, $this->requestStack, $layerRepositoryFactoryService, $entityFormBuilderService, $entityManager);
|
||||
$this->createSourceAction = new CreateSourceAction($this->actionService);
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,7 @@ namespace tests\Unit\Domain\ActionManagement;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Infinito\Domain\ActionManagement\ActionFactoryService;
|
||||
use Infinito\Domain\ActionManagement\ActionServiceInterface;
|
||||
use Infinito\Domain\ActionManagement\ActionDAOServiceInterface;
|
||||
use Infinito\Domain\ActionManagement\ActionInterface;
|
||||
use Infinito\Domain\RequestManagement\Action\RequestedAction;
|
||||
use Infinito\Domain\RequestManagement\Right\RequestedRight;
|
||||
@@ -25,7 +25,7 @@ class ActionFactoryServiceTest extends TestCase
|
||||
$userSourceDirector = $this->createMock(UserSourceDirectorInterface::class);
|
||||
$requestedUser = new RequestedUser($userSourceDirector, $requestedRight);
|
||||
$requestedAction = new RequestedAction($requestedUser);
|
||||
$actionService = $this->createMock(ActionServiceInterface::class);
|
||||
$actionService = $this->createMock(ActionDAOServiceInterface::class);
|
||||
$actionService->method('getRequestedAction')->willReturn($requestedAction);
|
||||
$actionFactoryService = new ActionFactoryService($actionService);
|
||||
$requestedAction->setLayer($layer);
|
||||
|
@@ -3,12 +3,12 @@
|
||||
namespace tests\Unit\Domain\ActionManagement;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Infinito\Domain\ActionManagement\ActionService;
|
||||
use Infinito\Domain\ActionManagement\ActionDAOService;
|
||||
use Infinito\Domain\RequestManagement\Action\RequestedActionInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Infinito\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
|
||||
use Infinito\Domain\ActionManagement\ActionServiceInterface;
|
||||
use Infinito\Domain\ActionManagement\ActionDAOServiceInterface;
|
||||
use Infinito\Repository\RepositoryInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Infinito\Domain\RequestManagement\Entity\RequestedEntityInterface;
|
||||
@@ -50,7 +50,7 @@ class ActionServiceTest extends TestCase
|
||||
private $layerRepositoryFactoryService;
|
||||
|
||||
/**
|
||||
* @var ActionServiceInterface
|
||||
* @var ActionDAOServiceInterface
|
||||
*/
|
||||
private $actionService;
|
||||
|
||||
@@ -84,7 +84,7 @@ class ActionServiceTest extends TestCase
|
||||
$this->requestStack = $this->createMock(RequestStack::class);
|
||||
$this->layerRepositoryFactoryService = $this->createMock(LayerRepositoryFactoryServiceInterface::class);
|
||||
$this->entityManager = $this->createMock(EntityManagerInterface::class);
|
||||
$this->actionService = new ActionService($this->requestedActionService, $this->secureRequestedRightCheckerService, $this->requestStack, $this->layerRepositoryFactoryService, $this->requestedActionFormBuilderService, $this->entityManager);
|
||||
$this->actionService = new ActionDAOService($this->requestedActionService, $this->secureRequestedRightCheckerService, $this->requestStack, $this->layerRepositoryFactoryService, $this->requestedActionFormBuilderService, $this->entityManager);
|
||||
}
|
||||
|
||||
public function testIsRequestedActionSecure(): void
|
||||
|
@@ -5,7 +5,7 @@ namespace tests\Unit\Domain\ActionManagement\Read;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Infinito\Domain\ActionManagement\ActionInterface;
|
||||
use Infinito\Domain\ActionManagement\AbstractAction;
|
||||
use Infinito\Domain\ActionManagement\ActionServiceInterface;
|
||||
use Infinito\Domain\ActionManagement\ActionDAOServiceInterface;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Infinito\Exception\NotValidByFormException;
|
||||
|
||||
@@ -20,13 +20,13 @@ class AbstractActionTest extends TestCase
|
||||
private $action;
|
||||
|
||||
/**
|
||||
* @var ActionServiceInterface|MockObject
|
||||
* @var ActionDAOServiceInterface|MockObject
|
||||
*/
|
||||
private $actionService;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->actionService = $this->createMock(ActionServiceInterface::class);
|
||||
$this->actionService = $this->createMock(ActionDAOServiceInterface::class);
|
||||
$this->action = new class($this->actionService) extends AbstractAction {
|
||||
public $isSecure;
|
||||
public $validByForm;
|
||||
|
@@ -5,7 +5,7 @@ namespace tests\Unit\Domain\SecureCRUDManagement\CRUD\Read;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Infinito\Domain\ActionManagement\Read\ReadAction;
|
||||
use Infinito\Domain\ActionManagement\ActionServiceInterface;
|
||||
use Infinito\Domain\ActionManagement\ActionDAOServiceInterface;
|
||||
use Infinito\Domain\ActionManagement\Read\ReadActionInterface;
|
||||
use Infinito\Exception\NotSecureException;
|
||||
use Infinito\Domain\RequestManagement\Action\RequestedActionInterface;
|
||||
@@ -23,7 +23,7 @@ class ReadSourceActionTest extends TestCase
|
||||
private $entityManager;
|
||||
|
||||
/**
|
||||
* @var ActionServiceInterface
|
||||
* @var ActionDAOServiceInterface
|
||||
*/
|
||||
private $actionService;
|
||||
|
||||
@@ -50,7 +50,7 @@ class ReadSourceActionTest extends TestCase
|
||||
$this->entityManager = $this->createMock(EntityManagerInterface::class);
|
||||
$this->requestedAction = $this->createMock(RequestedActionInterface::class);
|
||||
$this->requestedAction->method('getRequestedEntity')->willReturn($this->requestedEntity);
|
||||
$this->actionService = $this->createMock(ActionServiceInterface::class);
|
||||
$this->actionService = $this->createMock(ActionDAOServiceInterface::class);
|
||||
$this->actionService->method('getEntityManager')->willReturn($this->entityManager);
|
||||
$this->actionService->method('getRequestedAction')->willReturn($this->requestedAction);
|
||||
$this->sourceReadAction = new ReadAction($this->actionService);
|
||||
|
Reference in New Issue
Block a user