public function testOrderBySingleValueWithDescOrder()
 {
     $queryStringOrderBy = "@orderby=-name";
     $qs = $queryStringOrderBy;
     $q = new yehiaHamid\easyParse\QueryStringParser($qs);
     $result = $q->orderBy();
     $this->assertTrue($result[0]->field == "name");
     $this->assertTrue($result[0]->direction == "desc");
 }
Exemple #2
0
if (isset($argv[1])) {
    $queryString = $argv[1];
}
hr();
echo urldecode($queryString);
hr();
$parser = new \yehiaHamid\easyParse\QueryStringParser($queryString);
print_r($parser->get("anyThing"));
hr();
print_r($parser->get("customwithQuotes"));
hr();
print_r($parser->filters());
hr();
print_r($parser->fields());
hr();
print_r($parser->orderBy("firsrField,-secondField"));
hr();
print_r($parser->embed());
// $input = ["fieldone eq 'value one'"];
$input = "name eq 'what ever', fieldname1_a ne \"that's term\" , 1any ne '10/12/122'";
hr();
// var_dump($result);
hr();
// $result = FilterParser::run($result);
hr();
// var_dump($result);
hr();
foreach ($parser->filters() as $filter) {
    hr();
    print_r($filter->getOperator());
}