Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
deleteLanguageForLocale example
$this
->context
)
;
$this
->themeLifecycleService->
refreshTheme
(
$bundle
,
$this
->context
)
;
$theme
=
$this
->
getTheme
(
$bundle
)
;
static
::
assertEquals
(
$previewMediaId
,
$theme
->
getPreviewMediaId
(
)
)
;
}
public
function
testItSkipsTranslationsIfLanguageIsNotAvailable
(
)
: void
{
$bundle
=
$this
->
getThemeConfigWithLabels
(
)
;
$this
->
deleteLanguageForLocale
(
'de-DE'
)
;
$this
->themeLifecycleService->
refreshTheme
(
$bundle
,
$this
->context
)
;
$theme
=
$this
->
getTheme
(
$bundle
)
;
static
::
assertInstanceOf
(
ThemeTranslationCollection::
class
,
$theme
->
getTranslations
(
)
)
;
static
::
assertCount
(
1,
$theme
->
getTranslations
(
)
)
;
static
::
assertEquals
(
'en-GB',
$theme
->
getTranslations
(
)
->
first
(
)
?->
getLanguage
(
)
?->
getLocale
(
)
?->
getCode
(
)
)
;
static
::
assertEquals
(
[
'fields.sw-image' => 'test label',
]
,
$theme
->
getTranslations
(
)
->
first
(
)
?->
getLabels
(
)
)
;