Optimized FixtureSources and menu

This commit is contained in:
Kevin Frantz
2019-03-29 23:21:52 +01:00
parent 4280489499
commit db2e4dac01
18 changed files with 195 additions and 88 deletions

View File

@@ -30,14 +30,14 @@ class SourceFixturesIntegrationTest extends KernelTestCase
public function testImpressumSource(): void
{
$sourceRepository = $this->entityManager->getRepository(AbstractSource::class);
$imprint = $sourceRepository->findOneBySlug(ImpressumFixtureSource::SLUG);
$imprint = $sourceRepository->findOneBySlug(ImpressumFixtureSource::getSlug());
$this->assertInternalType('string', $imprint->getText());
}
public function testGuestUserSource(): void
{
$sourceRepository = $this->entityManager->getRepository(AbstractSource::class);
$userSource = $sourceRepository->findOneBySlug(GuestUserFixtureSource::SLUG);
$userSource = $sourceRepository->findOneBySlug(GuestUserFixtureSource::getSlug());
$this->assertInstanceOf(UserSourceInterface::class, $userSource);
}
}

View File

@@ -37,9 +37,9 @@ class ActionHandlerServiceIntegrationTest extends KernelTestCase
$this->requestedActionService = self::$container->get(RequestedActionServiceInterface::class);
}
public function testEnityManager(): void
public function testEntityManager(): void
{
$this->requestedActionService->getRequestedEntity()->setSlug(ImpressumFixtureSource::SLUG);
$this->requestedActionService->getRequestedEntity()->setSlug(ImpressumFixtureSource::getSlug());
$this->requestedActionService->setActionType(ActionType::READ);
$this->requestedActionService->setLayer(LayerType::SOURCE);
$this->assertInstanceOf(SourceInterface::class, $this->actionHandlerService->handle());

View File

@@ -4,6 +4,7 @@ namespace tests\Integration\Domain\FixtureManagement;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpFoundation\Request;
use Infinito\Domain\FixtureManagement\FixtureSource\ImpressumFixtureSource;
/**
* @author kevinfrantz
@@ -23,7 +24,7 @@ class ImprintFixtureSourceTest extends KernelTestCase
public function testImprintSourceReachable(): void
{
$request = new Request([], [], [], [], [], [
'REQUEST_URI' => 'api/rest/source/imprint.html',
'REQUEST_URI' => 'api/rest/source/'.ImpressumFixtureSource::getSlug().'.html',
]);
$request->setMethod(Request::METHOD_GET);
$response = static::$kernel->handle($request);