X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2FMediaWikiTestCase.php;h=652b1ee1bf8863412ca8fc1368c891a6e8a97923;hp=ed6479c8dccd3684ebd0d7d29cc8f4189a1fc8c3;hb=8624538de243da3779db5eb3362bedf78d2e2931;hpb=bdf062a8e9f351d3b94f99f2cbe9f7176f0b8801 diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index ed6479c8dc..652b1ee1bf 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -14,7 +14,7 @@ use Wikimedia\TestingAccessWrapper; /** * @since 1.18 */ -abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { +abstract class MediaWikiTestCase extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; @@ -260,20 +260,19 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * 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' ); @@ -1080,6 +1079,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { } } + SiteStatsInit::doPlaceholderInit(); + User::resetIdByNameCache(); // Make sysop user @@ -1596,9 +1597,9 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * @param string $function */ public function hideDeprecated( $function ) { - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); wfDeprecated( $function ); - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); } /** @@ -1892,9 +1893,9 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { # 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" );