$this->assertEquals('SELECT * FROM foobar', $e->getQuery());
}
}
+
+ public function testTransactions()
+ {
+ $this->fixture->begin();
+ $this->fixture->query("INSERT INTO test (textstuff) VALUES ('foo')");
+ $this->fixture->commit();
+
+ $res = $this->fixture->query("SELECT * FROM test WHERE textstuff = 'foo'");
+ $this->assertEquals(1, $this->fixture->numRows($res));
+
+ $this->fixture->begin();
+ $this->fixture->query("UPDATE test SET textstuff = 'abc'");
+ $this->fixture->rollback();
+
+ $res = $this->fixture->query("SELECT * FROM test WHERE textstuff = 'abc'");
+ $this->assertEquals(0, $this->fixture->numRows($res));
+
+ $res = $this->fixture->query("SELECT * FROM test WHERE textstuff = 'foo'");
+ $this->assertEquals(1, $this->fixture->numRows($res));
+ }
}
?>
\ No newline at end of file