/** * @group unit */ public function testFilterInsideHasParent() { $f = new \Elastica\Filter\MatchAll(); $type = 'test'; $filter = new HasParent($f, $type); $expectedArray = array('has_parent' => array('filter' => $f->toArray(), 'type' => $type)); $this->assertEquals($expectedArray, $filter->toArray()); }
public function testSetScope() { $q = new MatchAll(); $type = 'test'; $scope = 'foo'; $filter = new HasParent($q, $type); $filter->setScope($scope); $expectedArray = array('has_parent' => array('query' => $q->toArray(), 'type' => $type, '_scope' => $scope)); $this->assertEquals($expectedArray, $filter->toArray()); }