yield 'test query' =>
[ (new Criteria())->
addQuery(new ScoreQuery(new EqualsFilter('foo', 'bar'
), 100
)),
'{"total-count-mode":0,"query":[{"score":100.0,"query":{"type":"equals","field":"foo","value":"bar"},"scoreField":null,"extensions":[]}]}',
];
yield 'test aggregation' =>
[ (new Criteria())->
addAggregation(new CountAggregation('foo', 'bar'
)),
'{"total-count-mode":0,"aggregations":[{"name":"foo","type":"count","field":"bar"}]}',
];
yield 'test grouping' =>
[ (new Criteria())->
addGroupField(new FieldGrouping('foo'
)),
'{"total-count-mode":0,"grouping":["foo"]}',
];
} public function testConstructorDoesNotAllowEmptyIdArray(): void
{ static::
expectException(InvalidCriteriaIdsException::
class);
try { new Criteria([''
]);
} catch (InvalidCriteriaIdsException
$e) {