/**
* @since 1.18
*/
-abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
+abstract class MediaWikiTestCase extends PHPUnit\Framework\TestCase {
use MediaWikiCoversValidator;
* which we can't allow, as that would open a new connection for mysql.
* Replace with a HashBag. They would not be going to persist anyway.
*/
- $hashCache = [ 'class' => 'HashBagOStuff', 'reportDupes' => false ];
+ $hashCache = [ 'class' => HashBagOStuff::class, 'reportDupes' => false ];
$objectCaches = [
CACHE_DB => $hashCache,
CACHE_ACCEL => $hashCache,
CACHE_MEMCACHED => $hashCache,
'apc' => $hashCache,
'apcu' => $hashCache,
- 'xcache' => $hashCache,
'wincache' => $hashCache,
] + $baseConfig->get( 'ObjectCaches' );
$defaultOverrides->set( 'ObjectCaches', $objectCaches );
$defaultOverrides->set( 'MainCacheType', CACHE_NONE );
- $defaultOverrides->set( 'JobTypeConf', [ 'default' => [ 'class' => 'JobQueueMemory' ] ] );
+ $defaultOverrides->set( 'JobTypeConf', [ 'default' => [ 'class' => JobQueueMemory::class ] ] );
// Use a fast hash algorithm to hash passwords.
$defaultOverrides->set( 'PasswordDefault', 'A' );
}
}
+ SiteStatsInit::doPlaceholderInit();
+
User::resetIdByNameCache();
// Make sysop user
*/
private function resetDB( $db, $tablesUsed ) {
if ( $db ) {
- $userTables = [ 'user', 'user_groups', 'user_properties' ];
- $pageTables = [ 'page', 'revision', 'ip_changes', 'revision_comment_temp', 'comment' ];
+ $userTables = [ 'user', 'user_groups', 'user_properties', 'actor' ];
+ $pageTables = [ 'page', 'revision', 'ip_changes', 'revision_comment_temp',
+ 'revision_actor_temp', 'comment' ];
$coreDBDataTables = array_merge( $userTables, $pageTables );
// If any of the user or page tables were marked as used, we should clear all of them.
* @param string $function
*/
public function hideDeprecated( $function ) {
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
wfDeprecated( $function );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
}
/**
# This check may also protect against code injection in
# case of broken installations.
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
$haveDiff3 = $wgDiff3 && file_exists( $wgDiff3 );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
if ( !$haveDiff3 ) {
$this->markTestSkipped( "Skip test, since diff3 is not configured" );