$productEntity3 =
new ProductEntity();
$productEntity3->
assign(['id' => 'test-3', 'name' => 'foo'
]);
$productEntity3->
setUniqueIdentifier('test-3'
);
$productEntity4 =
new ProductEntity();
$productEntity4->
assign(['id' => 'test-4', 'name' => 'foo'
]);
$productEntity4->
setUniqueIdentifier('test-4'
);
$reader ->
expects(static::
once()) ->
method('read'
) ->
willReturn(new ProductCollection([$productEntity,
$productEntity2,
$productEntity3,
$productEntity4]));
$searcher =
$this->
createMock(EntitySearcherInterface::
class);
$data =
[ 'test-1' =>
['data' =>
['fullText' => 'foo'
], 'primaryKey' => 'test-1'
],
'test-2' =>
['data' =>
[], 'primaryKey' => 'test-2'
],
'test-3' =>
['data' =>
[], 'primaryKey' => 'test-3'
],
];
$searcher ->
expects(static::
once()) ->
method('search'
) ->
willReturn(new IdSearchResult(4,
$data,
new Criteria(), Context::
createDefaultContext()));