public function testCreateEntity(): void
{ $id = Uuid::
randomHex();
$this->repository->
create([ ['id' =>
$id, 'type' => 'equals', 'value' => 'awesome', 'field' => 'product.name', 'productStreamId' =>
$this->streamId
],
],
$this->context
);
/** @var ProductStreamEntity $entity */
$entity =
$this->productStreamRepository->
search(new Criteria([$this->streamId
]),
$this->context
)->
get($this->streamId
);
static::
assertSame([['type' => 'equals', 'field' => 'product.name', 'value' => 'awesome'
]],
$entity->
getApiFilter());
} public function testUpdateEntity(): void
{ $id = Uuid::
randomHex();
$this->repository->
create([ ['id' =>
$id, 'type' => 'equals', 'value' => 'new awesome', 'field' => 'product.name', 'productStreamId' =>
$this->streamId
],
],
$this->context
);
$this->repository->
upsert([ ['id' =>
$id, 'type' => 'range', 'field' => 'product.weight', 'parameters' =>
[RangeFilter::GT => 0.5, RangeFilter::LT => 100
], 'productStreamId' =>
$this->streamId
],
],
$this->context
);