$this->systemConfigRepository =
$this->
getContainer()->
get('system_config.repository'
);
$this->cmsPageRepository =
$this->
getContainer()->
get('cms_page.repository'
);
$this->salesChannelContext =
$contextFactory->
create(Uuid::
randomHex(), TestDefaults::SALES_CHANNEL
);
$this->errorLayoutId =
$this->
createPage();
$this->systemConfigService->
set('core.basicInformation.http404Page',
$this->errorLayoutId
);
} public function testItDoesLoad404CmsLayoutPageIn404Case(): void
{ $request =
new Request();
$context =
$this->
createSalesChannelContextWithNavigation();
/** @var ErrorPageLoadedEvent $event */
$event = null;
$this->
catchEvent(ErrorPageLoadedEvent::
class,
$event);
$page =
$this->
getPageLoader()->
load($this->errorLayoutId,
$request,
$context);
static::
assertInstanceOf(ErrorPage::
class,
$page);
self::
assertPageEvent(ErrorPageLoadedEvent::
class,
$event,
$context,
$request,
$page);
static::
assertSame('404 layout',
$page->
getCmsPage()->
getName());
}