/** * Tests if CardinalityAggregation#getArray throws exception when expected. * * @expectedException \LogicException * @expectedExceptionMessage Cardinality aggregation must have field or script set. */ public function testGetArrayException() { $aggregation = new CardinalityAggregation('bar'); $aggregation->getArray(); }