Example #1
0
 public function testQuery()
 {
     $db = $this->connectionFactory->get('R');
     $query = new Query("%json:%", array('json' => new Json('"spanner"')));
     $this->assertSame($query->parse($db), "'\"spanner\"'");
 }
Example #2
0
 public function testSqlConstant()
 {
     $db = $this->connectionFactory->get('RW');
     foreach (array('', 'text') as $type) {
         $query = new Query("%name:{$type}%", array('name' => new Constant('DEFAULT')));
         $this->assertSame($query->parse($db), 'DEFAULT');
     }
 }
Example #3
0
 public function testSerialization()
 {
     $queryIn = new Query('f*****g bugs suck', array('annoying severity', 'x4 corrosive'));
     $s = $queryIn->serialize();
     $queryOut = \Bond\unserialize_t($s);
 }
Example #4
0
 public function testQuery()
 {
     $db = $this->connectionFactory->get('R');
     $query = new Query("%ip:%", array('ip' => new Inet('1.1.1.1')));
     $this->assertSame($query->parse($db), "'1.1.1.1'");
 }