コード例 #1
0
 /**
  * @group unit
  */
 public function testFilterInsideHasChild()
 {
     $f = new \Elastica\Filter\MatchAll();
     $type = 'test';
     $filter = new HasChild($f, $type);
     $expectedArray = array('has_child' => array('filter' => $f->toArray(), 'type' => $type));
     $this->assertEquals($expectedArray, $filter->toArray());
 }
コード例 #2
0
ファイル: HasChildTest.php プロジェクト: kskod/Elastica
 public function testSetScope()
 {
     $q = new MatchAll();
     $type = 'test';
     $scope = 'foo';
     $filter = new HasChild($q, $type);
     $filter->setScope($scope);
     $expectedArray = array('has_child' => array('query' => $q->toArray(), 'type' => $type, '_scope' => $scope));
     $this->assertEquals($expectedArray, $filter->toArray());
 }