3 namespace Doctrine\Tests\DBAL\Functional\Ticket;
8 class DBAL202Test extends \Doctrine\Tests\DbalFunctionalTestCase
10 protected function setUp()
14 if ($this->_conn->getDatabasePlatform()->getName() != 'oracle') {
15 $this->markTestSkipped('OCI8 only test');
18 if ($this->_conn->getSchemaManager()->tablesExist('DBAL202')) {
19 $this->_conn->executeQuery('DELETE FROM DBAL202');
21 $table = new \Doctrine\DBAL\Schema\Table('DBAL202');
22 $table->addColumn('id', 'integer');
23 $table->setPrimaryKey(array('id'));
25 $this->_conn->getSchemaManager()->createTable($table);
29 public function testStatementRollback()
31 $stmt = $this->_conn->prepare('INSERT INTO DBAL202 VALUES (8)');
32 $this->_conn->beginTransaction();
34 $this->_conn->rollback();
36 $this->assertEquals(0, $this->_conn->query('SELECT COUNT(1) FROM DBAL202')->fetchColumn());
39 public function testStatementCommit()
41 $stmt = $this->_conn->prepare('INSERT INTO DBAL202 VALUES (8)');
42 $this->_conn->beginTransaction();
44 $this->_conn->commit();
46 $this->assertEquals(1, $this->_conn->query('SELECT COUNT(1) FROM DBAL202')->fetchColumn());