protected function setUp(): void
{ parent::
setUp();
$this->cmsPageRepository =
$this->
getContainer()->
get('cms_page.repository'
);
$this->systemConfigService =
$this->
getContainer()->
get(SystemConfigService::
class);
} public function testDeleteCmsPageDoesNotThrow(): void
{ $defaultCmsPageId = Uuid::
randomHex();
$this->
createCmsPage($defaultCmsPageId);
// create cms page to delete
$cmsPageId = Uuid::
randomHex();
$this->
createCmsPage($cmsPageId);
$this->systemConfigService->
set(ProductDefinition::CONFIG_KEY_DEFAULT_CMS_PAGE_PRODUCT,
$defaultCmsPageId, null
);
$this->systemConfigService->
set(ProductDefinition::CONFIG_KEY_DEFAULT_CMS_PAGE_PRODUCT,
$defaultCmsPageId, TestDefaults::SALES_CHANNEL
);
$id =
$this->cmsPageRepository->
searchIds(new Criteria([$cmsPageId]), Context::
createDefaultContext())->
firstId();
static::
assertEquals($cmsPageId,
$id);