Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
fetchExpectedSalesChannelIds example
$this
->languages =
$this
->
fetchLanguages
(
)
;
$this
->
createSalesChannels
(
)
;
$this
->
createUserForEachLanguage
(
)
;
}
public
function
testMigrationCopiesSalesChannelIdsIntoUserConfig
(
)
: void
{
$migration
=
$this
->
getMigration
(
)
;
$migration
->
update
(
$this
->connection
)
;
$expectedIds
=
$this
->
fetchExpectedSalesChannelIds
(
array_values
(
$this
->languages
)
)
;
$configs
=
$this
->
fetchConfigs
(
)
;
foreach
(
$configs
as
$locale
=>
$config
)
{
$language
=
$this
->languages
[
$locale
]
;
$actual
=
json_decode
(
(string)
$config
, null, 512, \JSON_THROW_ON_ERROR
)
;
$expected
= \
array_slice
(
$expectedIds
[
$language
]
, 0, self::MAX_RESULTS
)
;
static
::
assertSame
(
$expected
,
$actual
)
;
static
::
assertCount
(
self::MAX_RESULTS,
$actual
)
;
}
}