Exemplo n.º 1
0
 function testSelect()
 {
     $io = new \HandlerSocket\ReadSocket();
     $io->connect();
     $t = new HSReadTest($io);
     $this->assertEquals(array(array('key' => 42, 'date' => '2010-10-29', 'float' => '3.14159', 'varchar' => 'variable length', 'text' => "some\r\nbig\r\ntext", 'set' => 'a,c', 'union' => 'b', 'null' => NULL)), $t->select('=', 42));
 }
Exemplo n.º 2
0
 /**
  * @bug 1
  */
 function testSelectWithZeroValue()
 {
     $c = new \HandlerSocket\ReadSocket();
     $c->connect();
     $id = $c->getIndexId($this->db, 'read1', '', 'float');
     $c->select($id, '=', array(100));
     $response = $c->readResponse();
     $this->assertEquals(array(array(0)), $response);
 }
Exemplo n.º 3
0
 function testMultipleSelect()
 {
     $io = new \HandlerSocket\ReadSocket();
     $io->connect();
     $pipe = new \HandlerSocket\Pipeline($io);
     $accessor = new \HandlerSocket\ReadHandler($pipe, $this->db, 'read1', array('key'), '', array('float'));
     $accessor->select('=', 42);
     $accessor->select('=', 12);
     $this->assertEquals(array(array(array('float' => '3.14159')), array(array('float' => '12345'))), $pipe->execute());
 }