Ejemplo n.º 1
0
 public function testQueryQuoteSafe()
 {
     $db = $this->connectionFactory->get('R');
     $set = new Integer();
     $set->sqlIdentifierSet('n');
     $this->assertSame($set->parse($db), "FALSE");
     $set->add('-');
     $this->assertSame($set->parse($db), "( n IS NOT NULL )");
 }
Ejemplo n.º 2
0
 public function testAdd()
 {
     $set = new Integer(1);
     $set->add(2);
     $this->assertSame((string) $set, '1-2');
     $set = new Integer(1);
     $set->add(1);
     $this->assertSame((string) $set, '1');
     $set = new Integer(1);
     $set->add('10-');
     $this->assertSame((string) $set, '1,10-');
     $set = new Integer('-');
     $set->add('10');
     $this->assertSame((string) $set, '-');
     // chaining
     $this->assertSame($set->add(6), $set);
     $this->assertSame($set->add(), $set);
 }