$this->searchBuilder->
expects(static::
once())->
method('build'
);
$suggestCriteriaEventFired = false;
$this->eventDispatcher->
addListener( ProductEvents::PRODUCT_SUGGEST_CRITERIA,
static function DProductSuggestCriteriaEvent
$event) use (&
$suggestCriteriaEventFired): void
{ $suggestCriteriaEventFired = true;
static::
assertTrue( $event->
getCriteria()->
hasState(Criteria::STATE_ELASTICSEARCH_AWARE
),
'Criteria should be Elasticsearch aware'
);
} );
$suggestResultEventFired = false;
$this->eventDispatcher->
addListener( ProductEvents::PRODUCT_SUGGEST_RESULT,
static function DProductSuggestResultEvent
$event) use (&
$suggestResultEventFired): void
{ $suggestResultEventFired = true;