$appInfo =
$this->
installApp(__DIR__ . '/_fixtures/apps/withProductPermission'
);
$facade =
$this->factory->
factory( new TestHook('test', Context::
createDefaultContext()),
new Script('test', '',
new \
DateTimeImmutable(),
$appInfo) );
$result =
$facade->
search('product',
[]);
static::
assertCount(4,
$result);
$result =
$facade->
ids('product',
[]);
static::
assertCount(4,
$result->
getIds());
$result =
$facade->
aggregate('product',
[ 'aggregations' =>
[ ['name' => 'sum', 'type' => 'sum', 'field' => 'price.gross'
],
],
]);
$agg =
$result->
get('sum'
);
static::
assertInstanceOf(SumResult::
class,
$agg);
static::
assertEquals(600,
$agg->
getSum());
}