/** * Test toArray method. */ public function testToArrayItShouldReturnStdClass() { $filter = new MatchAllFilter(); $result = $filter->toArray(); $expectedResult = []; $this->assertEquals($expectedResult, $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()); }