Exemplo n.º 1
0
 function testChaining()
 {
     $startId = $this->db->insert('test_db_table', array('description' => ''));
     $this->db->insert('test_db_table', array('description' => ''));
     $description = 'Some description';
     $title = 'Some title';
     $query = new lmbUpdateQuery('test_db_table', $this->conn);
     $query->set(array('description' => $description))->field('title', $title)->where($this->conn->quoteIdentifier('id') . '=' . intval($startId + 1))->execute();
     $rs = $this->db->select('test_db_table');
     $rs->rewind();
     $record = $rs->current();
     //this one is not changed
     $this->assertEqual($record->get('id'), $startId);
     $this->assertEqual($record->get('title'), '');
     $this->assertEqual($record->get('description'), '');
     $rs->next();
     $record = $rs->current();
     //$this->assertEqual($record->get('id'), $startId + 11);
     $this->assertEqual($record->get('title'), $title);
     $this->assertEqual($record->get('description'), $description);
 }