$criteria->
setLimit(200
);
// check that provided criteria has other key
$route->
load($ids->
get('product'
),
new Request(),
$context,
$criteria);
} public static function criteriaProvider(): \Generator
{ yield 'Paginated criteria' =>
[(new Criteria())->
setOffset(1
)->
setLimit(20
)];
yield 'Filtered criteria' =>
[(new Criteria())->
addFilter(new EqualsFilter('active', true
))];
yield 'Post filtered criteria' =>
[(new Criteria())->
addPostFilter(new EqualsFilter('active', true
))];
yield 'Aggregation criteria' =>
[(new Criteria())->
addAggregation(new StatsAggregation('name', 'name'
))];
yield 'Query criteria' =>
[(new Criteria())->
addQuery(new ScoreQuery(new EqualsFilter('active', true
), 200
))];
yield 'Term criteria' =>
[(new Criteria())->
setTerm('test'
)];
yield 'Sorted criteria' =>
[(new Criteria())->
addSorting(new FieldSorting('active'
))];
} /**
* @dataProvider invalidationProvider
*/
public function testInvalidation(IdsCollection
$ids, \Closure
$before, \Closure
$after, int
$calls): void
{