MediaWikiTestCase::teardown() will now rollback any transactions
left open by a test case. This is intended to make sure tests do
not provide "interesting" results casued by transaction state
leaking from other tests.
Change-Id: Ia225251efd5aafbaa6674e2732ab1ba7761bfadc
}
protected function tearDown() {
- // Cleaning up temoporary files
+ // Cleaning up temporary files
foreach ( $this->tmpfiles as $fname ) {
if ( is_file( $fname ) || ( is_link( $fname ) ) ) {
unlink( $fname );
}
}
+ // clean up open transactions
+ if( $this->needsDB() && $this->db ) {
+ while( $this->db->trxLevel() > 0 ) {
+ $this->db->rollback();
+ }
+ }
+
parent::tearDown();
}