/** * Test GetArray method. */ public function testFiltersAggregationGetArray() { $mock = $this->getMockBuilder('ONGR\\ElasticsearchDSL\\BuilderInterface')->getMock(); $aggregation = new FiltersAggregation('test_agg'); $aggregation->setAnonymous(true); $aggregation->addFilter($mock, 'name'); $result = $aggregation->getArray(); $this->assertArrayHasKey('filters', $result); }