Make LocalisationCache a service
[lhc/web/wiklou.git] / tests / phpunit / MediaWikiIntegrationTestCase.php
index 8a188bf..24a601e 100644 (file)
@@ -407,6 +407,7 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
 
                $wgRequest = new FauxRequest();
                MediaWiki\Session\SessionManager::resetCache();
+               Language::clearCaches();
        }
 
        public function run( PHPUnit_Framework_TestResult $result = null ) {
@@ -1465,7 +1466,7 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
                        $db->_originalTablePrefix = $oldPrefix;
 
                        $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
-                       $lb->setTempTablesOnlyMode( self::$useTemporaryTables, $lb->getLocalDomainID() );
+                       $lb->setTempTablesOnlyMode( self::$useTemporaryTables, $db->getDomainID() );
                }
 
                return true;
@@ -2387,32 +2388,6 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
                $this->mergeMwGlobalArrayValue( 'wgHooks', [ $hookName => [ $handler ] ] );
        }
 
-       /**
-        * Check whether file contains given data.
-        * @param string $fileName
-        * @param string $actualData
-        * @param bool $createIfMissing If true, and file does not exist, create it with given data
-        *                              and skip the test.
-        * @param string $msg
-        * @since 1.30
-        */
-       protected function assertFileContains(
-               $fileName,
-               $actualData,
-               $createIfMissing = false,
-               $msg = ''
-       ) {
-               if ( $createIfMissing ) {
-                       if ( !file_exists( $fileName ) ) {
-                               file_put_contents( $fileName, $actualData );
-                               $this->markTestSkipped( "Data file $fileName does not exist" );
-                       }
-               } else {
-                       self::assertFileExists( $fileName );
-               }
-               self::assertEquals( file_get_contents( $fileName ), $actualData, $msg );
-       }
-
        /**
         * Edits or creates a page/revision
         * @param string $pageName Page title