X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=vendor%2Fdoctrine%2Fdbal%2Ftests%2FDoctrine%2FTests%2FDBAL%2FFunctional%2FTicket%2FDBAL202Test.php;fp=vendor%2Fdoctrine%2Fdbal%2Ftests%2FDoctrine%2FTests%2FDBAL%2FFunctional%2FTicket%2FDBAL202Test.php;h=4448ed73de85981063a89deb80bee0d0dccfa5ce;hb=8b04b2d11798dee4f3e1358e4f43e97a6df851f6;hp=0000000000000000000000000000000000000000;hpb=73568cf05a785a45f94ca3f2351d9e07bf917958;p=zf2.biz%2Fapplication_blanche.git diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL202Test.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL202Test.php new file mode 100644 index 0000000..4448ed7 --- /dev/null +++ b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL202Test.php @@ -0,0 +1,48 @@ +_conn->getDatabasePlatform()->getName() != 'oracle') { + $this->markTestSkipped('OCI8 only test'); + } + + if ($this->_conn->getSchemaManager()->tablesExist('DBAL202')) { + $this->_conn->executeQuery('DELETE FROM DBAL202'); + } else { + $table = new \Doctrine\DBAL\Schema\Table('DBAL202'); + $table->addColumn('id', 'integer'); + $table->setPrimaryKey(array('id')); + + $this->_conn->getSchemaManager()->createTable($table); + } + } + + public function testStatementRollback() + { + $stmt = $this->_conn->prepare('INSERT INTO DBAL202 VALUES (8)'); + $this->_conn->beginTransaction(); + $stmt->execute(); + $this->_conn->rollback(); + + $this->assertEquals(0, $this->_conn->query('SELECT COUNT(1) FROM DBAL202')->fetchColumn()); + } + + public function testStatementCommit() + { + $stmt = $this->_conn->prepare('INSERT INTO DBAL202 VALUES (8)'); + $this->_conn->beginTransaction(); + $stmt->execute(); + $this->_conn->commit(); + + $this->assertEquals(1, $this->_conn->query('SELECT COUNT(1) FROM DBAL202')->fetchColumn()); + } +}