$themeLoader =
$this->
getContainer()->
get(SalesChannelThemeLoader::
class);
// Install the app
$this->
loadAppsFromDir(__DIR__ . '/Fixtures/theme'
);
$this->
reloadAppSnippets();
// Ensure the default Storefront theme is active
$criteria =
new Criteria();
$criteria->
addFilter(new EqualsFilter('technicalName', 'Storefront'
));
$defaultThemeId =
$themeRepo->
searchIds($criteria,
$salesChannelContext->
getContext())->
firstId();
static::
assertNotNull($defaultThemeId, 'Default theme not found'
);
$themeService->
assignTheme($defaultThemeId,
$salesChannelContext->
getSalesChannelId(),
$salesChannelContext->
getContext(), true
);
// Inject the sales channel and assert that the original snippet is used
$translator->
injectSettings( $salesChannelContext->
getSalesChannelId(),
$salesChannelContext->
getLanguageId(),
'en-GB',
$salesChannelContext->
getContext() );
static::
assertEquals('Service date equivalent to invoice date',
$translator->
trans('document.serviceDateNotice'
));