->
search($criteria,
$salesChannelContext) ->
first();
$subscriber =
$this->
getContainer()->
get(ProductSubscriber::
class);
$productLoadedEvent =
new EntityLoadedEvent( $this->
getContainer()->
get(ProductDefinition::
class),
[$productEntity],
Context::
createDefaultContext() );
$subscriber->
loaded($productLoadedEvent);
$sortedPropertiesCollection =
$productEntity->
getSortedProperties();
static::
assertInstanceOf(PropertyGroupCollection::
class,
$sortedPropertiesCollection);
$sortedProperties =
$sortedPropertiesCollection->
getElements();
foreach ($expected as $expectedGroupKey =>
$expectedGroup) { $optionElementsCollection =
$sortedProperties[$expectedGroupKey]->
getOptions();
static::
assertInstanceOf(PropertyGroupOptionCollection::
class,
$optionElementsCollection);
$optionElements =
$optionElementsCollection->
getElements();