/** * Tests if filter can be passed to constructor. */ public function testConstructorFilter() { $matchAllFilter = new MatchAllQuery(); $aggregation = new FilterAggregation('test', $matchAllFilter); $this->assertEquals(['filter' => $matchAllFilter->toArray()], $aggregation->toArray()); }
/** * Tests toArray(). */ public function testToArray() { $query = new MatchAllQuery(); $this->assertEquals(['match_all' => []], $query->toArray()); }
/** * Tests toArray(). */ public function testToArrayWithParams() { $params = ['boost' => 5]; $query = new MatchAllQuery($params); $this->assertEquals(['match_all' => $params], $query->toArray()); }