public function testRegexMatches() { $query = new Query("TestObject"); $query->matches("title", '(cl.?jre)[0-9]', "im"); $out = $query->encode(); $expect = json_encode(array("title" => array('$regex' => '(cl.?jre)[0-9]', '$options' => "im"))); $this->assertEquals($expect, $out["where"]); }