Commit eb0a49c2 authored by Marco Pivetta's avatar Marco Pivetta

Merge branch 'fix/#2638-tear-down-parent-transactions' into 2.5

Backport #2638 to 2.5.x
parents cc39799b 6765c21d
...@@ -21,6 +21,8 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -21,6 +21,8 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase
if ($this->portableConnection) { if ($this->portableConnection) {
$this->portableConnection->close(); $this->portableConnection->close();
} }
parent::tearDown();
} }
/** /**
......
...@@ -25,6 +25,8 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -25,6 +25,8 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->exec($this->_conn->getDatabasePlatform()->getDropTemporaryTableSQL($tempTable)); $this->_conn->exec($this->_conn->getDatabasePlatform()->getDropTemporaryTableSQL($tempTable));
} catch(\Exception $e) { } } catch(\Exception $e) { }
} }
parent::tearDown();
} }
/** /**
...@@ -108,4 +110,4 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -108,4 +110,4 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
$rows = $this->_conn->fetchAll('SELECT * FROM nontemporary'); $rows = $this->_conn->fetchAll('SELECT * FROM nontemporary');
$this->assertEquals(array(), $rows, "In an event of an error this result has one row, because of an implicit commit."); $this->assertEquals(array(), $rows, "In an event of an error this result has one row, because of an implicit commit.");
} }
} }
\ No newline at end of file
...@@ -41,6 +41,8 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -41,6 +41,8 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->getWrappedConnection()->setAttribute(PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, false); $this->_conn->getWrappedConnection()->setAttribute(PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, false);
} }
} }
parent::tearDown();
} }
public function testBooleanConversionSqlLiteral() public function testBooleanConversionSqlLiteral()
......
...@@ -40,7 +40,14 @@ class DbalFunctionalTestCase extends DbalTestCase ...@@ -40,7 +40,14 @@ class DbalFunctionalTestCase extends DbalTestCase
$this->_conn->getConfiguration()->setSQLLogger($this->_sqlLoggerStack); $this->_conn->getConfiguration()->setSQLLogger($this->_sqlLoggerStack);
} }
protected function onNotSuccessfulTest(\Exception $e) protected function tearDown()
{
while ($this->_conn->isTransactionActive()) {
$this->_conn->rollBack();
}
}
protected function onNotSuccessfulTest($e)
{ {
if ($e instanceof \PHPUnit_Framework_AssertionFailedError) { if ($e instanceof \PHPUnit_Framework_AssertionFailedError) {
throw $e; throw $e;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment