Beispiel #1
0
 /**
  * Test that when second condition property names start with "IN" we don't barf.
  */
 public function testMultiWhereWithInPrefix()
 {
     $obj_parser = new \GDS\Mapper\ProtoBufGQLParser();
     $obj_parser->parse('SELECT * FROM Person WHERE Test = "Thing" AND InstructionSet = "abc"');
     $this->assertEquals('Person', $obj_parser->getKind());
     $this->assertEquals([['lhs' => 'Test', 'op' => google\appengine\datastore\v4\PropertyFilter\Operator::EQUAL, 'comp' => '=', 'rhs' => 'Thing'], ['lhs' => 'InstructionSet', 'op' => google\appengine\datastore\v4\PropertyFilter\Operator::EQUAL, 'comp' => '=', 'rhs' => 'abc']], $obj_parser->getFilters());
 }
Beispiel #2
0
 public function testMultiWhere()
 {
     $obj_parser = new \GDS\Mapper\ProtoBufGQLParser();
     $obj_parser->parse('SELECT * FROM Person WHERE some_property = "grey" AND other_property = 10');
     $this->assertEquals('Person', $obj_parser->getKind());
     $this->assertEquals([['lhs' => 'some_property', 'op' => google\appengine\datastore\v4\PropertyFilter\Operator::EQUAL, 'comp' => '=', 'rhs' => 'grey'], ['lhs' => 'other_property', 'op' => google\appengine\datastore\v4\PropertyFilter\Operator::EQUAL, 'comp' => '=', 'rhs' => 10]], $obj_parser->getFilters());
 }