Beispiel #1
0
 public function testResourceWithFiltersAndFieldsAndSortForSecondResource()
 {
     $string = "customer,patient(@orderby=fieldOne,-fieldtow)(@fields=fieldOne,fieldtow,fieldthre)(@filters=filterOne eq 'filter term ')";
     $lexerResult = yehiaHamid\easyParse\parsers\embed\Lexer::run($string);
     $this->assertTrue("T_WORD" == $lexerResult[0]["token"]);
     $this->assertTrue("customer" == $lexerResult[0]["match"]);
     $this->assertTrue("T_COMMA" == $lexerResult[1]["token"]);
     $this->assertTrue("T_WORD" == $lexerResult[2]["token"]);
     $this->assertTrue("patient" == $lexerResult[2]["match"]);
     $this->assertTrue("T_ORDERBY" == $lexerResult[3]["token"]);
     $this->assertTrue("fieldOne,-fieldtow" == $lexerResult[3]["match"]);
     $this->assertTrue("T_FIELDS" == $lexerResult[4]["token"]);
     $this->assertTrue("fieldOne,fieldtow,fieldthre" == $lexerResult[4]["match"]);
     $this->assertTrue("T_FILTERS" == $lexerResult[5]["token"]);
     $this->assertTrue("filterOne eq 'filter term '" == $lexerResult[5]["match"]);
 }
Beispiel #2
0
 public function getLexerResult($string)
 {
     return yehiaHamid\easyParse\parsers\embed\Lexer::run($string);
 }