Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
removeAddedSalesChannel example
private
Connection
$connection
;
protected
function
setUp
(
)
: void
{
$this
->connection =
$this
->
getContainer
(
)
->
get
(
Connection::
class
)
;
$this
->
removeAddedDefaultDomains
(
)
;
}
protected
function
tearDown
(
)
: void
{
$this
->
removeAddedDefaultDomains
(
)
;
$this
->
removeAddedSalesChannel
(
)
;
}
public
function
testItAddsDefaultDomainToHeadlessSalesChannel
(
)
: void
{
$statement
=
$this
->connection->
prepare
(
'SELECT COUNT(*) FROM `sales_channel_domain` WHERE `sales_channel_id` = :salesChannelId'
)
;
$statement
->
bindValue
(
'salesChannelId', Uuid::
fromHexToBytes
(
TestDefaults::SALES_CHANNEL
)
)
;
$result
=
$statement
->
executeQuery
(
)
;
static
::
assertEquals
(
0,
$result
->
fetchOne
(
)
)
;
(
new
Migration1620820321AddDefaultDomainForHeadlessSaleschannel
(
)
)
->
update
(
$this
->connection
)
;