You are a developer and looking for Shopware projects?
Apply Now!
assertVariationsInListing example
->
create
(
Uuid::
randomHex
(
)
,
$this
->salesChannelId
)
;
$listing
=
$this
->
getContainer
(
)
->
get
(
ProductListingRoute::
class
)
->
load
(
$this
->categoryId,
$request
,
$context
,
new
Criteria
(
)
)
->
getResult
(
)
;
$products
=
$listing
->
getEntities
(
)
;
static
::
assertCount
(
10,
$products
)
;
static
::
assertFalse
(
$products
->
has
(
$this
->testData->
getId
(
'product1'
)
)
)
;
self::
assertVariationsInListing
(
$products
,
[
$this
->testData->
getId
(
'product1-red-l-steel'
)
,
$this
->testData->
getId
(
'product1-red-xl-steel'
)
,
$this
->testData->
getId
(
'product1-red-l-iron'
)
,
$this
->testData->
getId
(
'product1-red-xl-iron'
)
,
]
)
;
self::
assertVariationsInListing
(
$products
,
[
$this
->testData->
getId
(
'product1-green-l-steel'
)
,
$this
->testData->
getId
(
'product1-green-xl-steel'
)
,
$this
->testData->
getId
(
'product1-green-l-iron'
)
,
$this
->testData->
getId
(
'product1-green-xl-iron'
)
,
]
)
;