Exemplo n.º 1
0
 public function testTransactionTrue()
 {
     $data = array('page_template' => 'tpl_test_new3', 'page_type' => 'öäü');
     // will return the auto-increment value of the new row
     $resultInsert = $this->db->insert($this->tableName, $data);
     self::assertGreaterThan(1, $resultInsert);
     // start - test a transaction
     $this->db->startTransaction();
     $data = array('page_type' => 'lall');
     $where = array('page_id' => $resultInsert);
     $this->db->update($this->tableName, $data, $where);
     $data = array('page_type' => 'lall', 'page_template' => 'öäü');
     $where = array('page_id' => $resultInsert);
     $this->db->update($this->tableName, $data, $where);
     // end - test a transaction
     $this->db->endTransaction();
     $where = array('page_id' => $resultInsert);
     $resultSelect = $this->db->select($this->tableName, $where);
     $resultSelectArray = $resultSelect->fetchAllArray();
     self::assertEquals('lall', $resultSelectArray[0]['page_type']);
 }