/** * Tests GetType method, it should return 'match_all'. */ public function testGetType() { $filter = new MatchAllFilter(); $result = $filter->getType(); $this->assertEquals('match_all', $result); }
/** * Tests if filter can be passed to constructor. */ public function testConstructorFilter() { $matchAllFilter = new MatchAllFilter(); $aggregation = new FilterAggregation('test', $matchAllFilter); $this->assertSame(['filter' => [$matchAllFilter->getType() => $matchAllFilter->toArray()]], $aggregation->toArray()); }