'id' => Uuid::
randomBytes(),
'type' => 'equals',
'field' => 'product.id',
'value' =>
$productId,
'position' => 2,
'product_stream_id' => Uuid::
fromHexToBytes($id),
'created_at'
=> (new \
DateTime())->
format(Defaults::STORAGE_DATE_TIME_FORMAT
),
] );
$message =
$this->indexer->
update($this->
createWrittenEvent($id));
static::
assertInstanceOf(EntityIndexingMessage::
class,
$message);
$this->indexer->
handle($message);
/** @var ProductStreamEntity $entity */
$entity =
$this->productStreamRepository->
search(new Criteria([$id]),
$this->context
)->
get($id);
static::
assertNotNull($entity->
getApiFilter());
static::
assertCount(2,
$entity->
getApiFilter());
static::
assertSame('equals',
$entity->
getApiFilter()[0
]['type'
]);
static::
assertSame('product.manufacturerId',
$entity->
getApiFilter()[0
]['field'
]);
static::
assertSame($manufacturerId,
$entity->
getApiFilter()[0
]['value'
]);