MDL-37782 reset DB after each failed database test
Conflicts: lib/phpunit/classes/database_driver_testcase.php
This commit is contained in:
committed by
Eloy Lafuente (stronk7)
parent
2ec0ba91b8
commit
aca26e0641
@@ -133,4 +133,21 @@ abstract class database_driver_testcase extends PHPUnit_Framework_TestCase {
|
||||
phpunit_util::reset_all_data();
|
||||
parent::tearDownAfterClass();
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the bare test sequence.
|
||||
* @return void
|
||||
*/
|
||||
public function runBare() {
|
||||
try {
|
||||
parent::runBare();
|
||||
|
||||
} catch (Exception $e) {
|
||||
if ($this->tdb->is_transaction_started()) {
|
||||
$this->tdb->force_transaction_rollback();
|
||||
}
|
||||
$this->tearDown();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user