2019-02-16 10:47:41 +01:00
|
|
|
<?php
|
|
|
|
|
2019-05-30 16:03:44 +02:00
|
|
|
namespace tests\Integration\Domain\Action;
|
2019-02-16 10:47:41 +01:00
|
|
|
|
2020-04-02 21:13:35 +02:00
|
|
|
use Infinito\DBAL\Types\ActionType;
|
|
|
|
use Infinito\DBAL\Types\Meta\Right\LayerType;
|
2019-05-30 16:03:44 +02:00
|
|
|
use Infinito\Domain\Action\ActionHandlerServiceInterface;
|
2019-05-30 16:10:09 +02:00
|
|
|
use Infinito\Domain\Fixture\FixtureSource\ImpressumFixtureSource;
|
2020-04-02 21:13:35 +02:00
|
|
|
use Infinito\Domain\Request\Action\RequestedActionServiceInterface;
|
2019-02-17 14:33:19 +01:00
|
|
|
use Infinito\Entity\Source\SourceInterface;
|
2020-04-02 21:13:35 +02:00
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
2019-02-16 10:47:41 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
|
|
|
class ActionHandlerServiceIntegrationTest extends KernelTestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var ActionHandlerServiceInterface
|
|
|
|
*/
|
|
|
|
private $actionHandlerService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var RequestedActionServiceInterface
|
|
|
|
*/
|
|
|
|
private $requestedActionService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*
|
|
|
|
* @see \PHPUnit\Framework\TestCase::setUp()
|
|
|
|
*/
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
self::bootKernel();
|
|
|
|
$this->actionHandlerService = self::$container->get(ActionHandlerServiceInterface::class);
|
|
|
|
$this->requestedActionService = self::$container->get(RequestedActionServiceInterface::class);
|
|
|
|
}
|
|
|
|
|
2019-03-29 23:21:52 +01:00
|
|
|
public function testEntityManager(): void
|
2019-02-16 10:47:41 +01:00
|
|
|
{
|
2019-03-29 23:21:52 +01:00
|
|
|
$this->requestedActionService->getRequestedEntity()->setSlug(ImpressumFixtureSource::getSlug());
|
2019-02-16 10:47:41 +01:00
|
|
|
$this->requestedActionService->setActionType(ActionType::READ);
|
|
|
|
$this->requestedActionService->setLayer(LayerType::SOURCE);
|
|
|
|
$this->assertInstanceOf(SourceInterface::class, $this->actionHandlerService->handle());
|
|
|
|
}
|
|
|
|
}
|