if ( $this->needsDB() && $this->db ) {
// Clean up open transactions
while ( $this->db->trxLevel() > 0 ) {
- $this->db->rollback();
+ $this->db->rollback( __METHOD__, 'flush' );
}
}
}
protected function tearDown() {
+ global $wgRequest;
+
$status = ob_get_status();
if ( isset( $status['name'] ) &&
$status['name'] === 'MediaWikiTestCase::wfResetOutputBuffersBarrier'
if ( $this->needsDB() && $this->db ) {
// Clean up open transactions
while ( $this->db->trxLevel() > 0 ) {
- $this->db->rollback();
+ $this->db->rollback( __METHOD__, 'flush' );
}
}
$this->mwGlobals = array();
RequestContext::resetMain();
MediaHandler::resetCache();
+ if ( session_id() !== '' ) {
+ session_write_close();
+ session_id( '' );
+ }
+ $wgRequest = new FauxRequest();
+ MediaWiki\Session\SessionManager::resetCache();
$phpErrorLevel = intval( ini_get( 'error_reporting' ) );
false,
$user
);
+
+ // doEditContent() probably started the session via
+ // User::loadFromSession(). Close it now.
+ if ( session_id() !== '' ) {
+ session_write_close();
+ session_id( '' );
+ }
}
}
* @since 1.21
*/
public static function teardownTestDB() {
+ global $wgJobClasses;
+
if ( !self::$dbSetup ) {
return;
}
+ foreach ( $wgJobClasses as $type => $class ) {
+ // Delete any jobs under the clone DB (or old prefix in other stores)
+ JobQueueGroup::singleton()->get( $type )->delete();
+ }
+
CloneDatabase::changePrefix( self::$oldTablePrefix );
self::$oldTablePrefix = false;