ObjectCache::$instances[CACHE_DB] = new HashBagOStuff;
$needsResetDB = false;
- $logName = get_class( $this ) . '::' . $this->getName( false );
if ( $this->needsDB() ) {
// set up a DB connection for this test to use
$this->checkDbIsSupported();
if ( !self::$dbSetup ) {
- wfProfileIn( $logName . ' (clone-db)' );
-
// switch to a temporary clone of the database
self::setupTestDB( $this->db, $this->dbPrefix() );
if ( ( $this->db->getType() == 'oracle' || !self::$useTemporaryTables ) && self::$reuseDB ) {
$this->resetDB();
}
-
- wfProfileOut( $logName . ' (clone-db)' );
}
-
- wfProfileIn( $logName . ' (prepare-db)' );
$this->addCoreDBData();
$this->addDBData();
- wfProfileOut( $logName . ' (prepare-db)' );
-
$needsResetDB = true;
}
- wfProfileIn( $logName );
parent::run( $result );
- wfProfileOut( $logName );
if ( $needsResetDB ) {
- wfProfileIn( $logName . ' (reset-db)' );
$this->resetDB();
- wfProfileOut( $logName . ' (reset-db)' );
}
}
}
- protected function tearDown() {
+ protected function addTmpFiles( $files ) {
+ $this->tmpFiles = array_merge( $this->tmpFiles, (array)$files );
+ }
+ protected function tearDown() {
$this->called['tearDown'] = true;
// Cleaning up temporary files
foreach ( $this->tmpFiles as $fileName ) {
protected function insertPage( $pageName, $text = 'Sample page for unit test.' ) {
$title = Title::newFromText( $pageName, 0 );
- $user = User::newFromName( 'WikiSysop' );
+ $user = User::newFromName( 'UTSysop' );
$comment = __METHOD__ . ': Sample page for unit test.';
// Avoid memory leak...?
'UTPageSummary',
EDIT_NEW,
false,
- User::newFromName( 'UTSysop' )
+ $user
);
}
}
* @param string $msg
*/
private function assertEmpty2( $value, $msg ) {
- return $this->assertTrue( $value == '', $msg );
+ $this->assertTrue( $value == '', $msg );
}
private static function unprefixTable( $tableName ) {
/**
* @since 1.18
*
- * @param DataBaseBase $db
+ * @param DatabaseBase $db
*
* @return array
*/