Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addSalesChannel example
new
Migration1620820321AddDefaultDomainForHeadlessSaleschannel
(
)
)
->
update
(
$this
->connection
)
;
$result
=
$statement
->
executeQuery
(
)
;
static
::
assertEquals
(
1,
$result
->
fetchOne
(
)
)
;
}
public
function
testItAddsDefaultDomainToMultipleApiSalesChannel
(
)
: void
{
$statement
=
$this
->connection->
prepare
(
'SELECT COUNT(*) FROM `sales_channel_domain` WHERE `sales_channel_id` = :salesChannelId'
)
;
$firstApiSalesChannelId
=
$this
->
addSalesChannel
(
Defaults::SALES_CHANNEL_TYPE_API
)
;
$secondApiSalesChannelId
=
$this
->
addSalesChannel
(
Defaults::SALES_CHANNEL_TYPE_API
)
;
$firstStorefrontSalesChannelId
=
$this
->
addSalesChannel
(
Defaults::SALES_CHANNEL_TYPE_STOREFRONT
)
;
(
new
Migration1620820321AddDefaultDomainForHeadlessSaleschannel
(
)
)
->
update
(
$this
->connection
)
;
$result
=
$statement
->
executeQuery
(
[
'salesChannelId' => Uuid::
fromHexToBytes
(
TestDefaults::SALES_CHANNEL
)
]
)
;
static
::
assertEquals
(
1,
$result
->
fetchOne
(
)
)
;
$result
=
$statement
->
executeQuery
(
[
'salesChannelId' => Uuid::
fromHexToBytes
(
$firstApiSalesChannelId
)
]
)
;
static
::
assertEquals
(
1,
$result
->
fetchOne
(
)
)
;