示例#1
0
 /**
  * @group unit
  */
 public function testToArray()
 {
     $q = new MatchAll();
     $type = 'test';
     $filter = new HasChild($q, $type);
     $expectedArray = array('has_child' => array('query' => $q->toArray(), 'type' => $type));
     $this->assertEquals($expectedArray, $filter->toArray());
 }
 public function testSetScope()
 {
     $q = new MatchAll();
     $type = 'test';
     $scope = 'foo';
     $query = new HasParent($q, $type);
     $query->setScope($scope);
     $expectedArray = array('has_parent' => array('query' => $q->toArray(), 'type' => $type, '_scope' => $scope));
     $this->assertEquals($expectedArray, $query->toArray());
 }
 /**
  * @group unit
  */
 public function testToArray()
 {
     $query = new MatchAll();
     $expectedArray = array('match_all' => new \stdClass());
     $this->assertEquals($expectedArray, $query->toArray());
 }