Example #1
0
 public function testDoesNotMatchQuery()
 {
     Helper::clearClass("ChildObject");
     Helper::clearClass("ParentObject");
     $this->provideTestObjectsForQuery(10);
     $subQuery = new ParseQuery("ChildObject");
     $subQuery->greaterThan("x", 5);
     $query = new ParseQuery("ParentObject");
     $query->doesNotMatchQuery("child", $subQuery);
     $results = $query->find();
     $this->assertEquals(6, count($results), 'Did not return the correct object.');
     foreach ($results as $parentObj) {
         $this->assertLessThanOrEqual(15, $parentObj->get("x"), 'Did not return the correct object.');
         $this->assertGreaterThanOrEqual(10, $parentObj->get("x"), 'Did not return the correct object.');
     }
 }
Example #2
0
 /**
  * Allow to pass instances of either Query or ParseQuery.
  *
  * @param string           $key
  * @param Query|ParseQuery $query
  *
  * @return $this
  */
 public function doesNotMatchQuery($key, $query)
 {
     $this->parseQuery->doesNotMatchQuery($key, $this->parseQueryFromQuery($query));
     return $this;
 }