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()); }