static::
assertTrue($listing->
has($this->testData->
getId('product1-green'
)));
static::
assertTrue($listing->
has($this->testData->
getId('product1-blue'
)));
// product 2 has all available variants
static::
assertTrue($listing->
has($this->testData->
getId('product2-green'
)));
static::
assertTrue($listing->
has($this->testData->
getId('product2-red'
)));
/** @var EntityResult<PropertyGroupCollection> $result */
$result =
$listing->
getAggregations()->
get('properties'
);
$options =
$result->
getEntities();
$ids =
array_keys($options->
getOptionIdMap());
static::
assertContains($this->testData->
getId('green'
),
$ids);
static::
assertContains($this->testData->
getId('red'
),
$ids);
static::
assertContains($this->testData->
getId('blue'
),
$ids);
} public function testListingWithFilterEnabled(): void
{ // enable hideCloseoutProductsWhenOutOfStock filter
$this->
getContainer()->
get(SystemConfigService::
class) ->
set('core.listing.hideCloseoutProductsWhenOutOfStock', true
);