Merge "Delete autoload.ide.php"
[lhc/web/wiklou.git] / tests / phpunit / maintenance / backup_LogTest.php
index 91e1b1e..9357451 100644 (file)
@@ -1,4 +1,14 @@
 <?php
+
+namespace MediaWiki\Tests\Maintenance;
+
+use MediaWiki\MediaWikiServices;
+use DumpBackup;
+use ManualLogEntry;
+use Title;
+use User;
+use WikiExporter;
+
 /**
  * Tests for log dumps of BackupDumper
  *
@@ -136,8 +146,6 @@ class BackupDumperLoggerTest extends DumpTestCase {
        }
 
        function testPlain() {
-               global $wgContLang;
-
                // Preparing the dump
                $fname = $this->getNewTempFile();
 
@@ -156,8 +164,9 @@ class BackupDumperLoggerTest extends DumpTestCase {
                $this->assertLogItem( $this->logId1, "BackupDumperLogUserA",
                        $this->userId1, null, "type", "subtype", "PageA" );
 
-               $this->assertNotNull( $wgContLang, "Content language object validation" );
-               $namespace = $wgContLang->getNsText( NS_TALK );
+               $contLang = MediaWikiServices::getInstance()->getContentLanguage();
+               $this->assertNotNull( $contLang, "Content language object validation" );
+               $namespace = $contLang->getNsText( NS_TALK );
                $this->assertInternalType( 'string', $namespace );
                $this->assertGreaterThan( 0, strlen( $namespace ) );
                $this->assertLogItem( $this->logId2, "BackupDumperLogUserB",
@@ -172,8 +181,6 @@ class BackupDumperLoggerTest extends DumpTestCase {
        }
 
        function testXmlDumpsBackupUseCaseLogging() {
-               global $wgContLang;
-
                $this->checkHasGzip();
 
                // Preparing the dump
@@ -209,8 +216,9 @@ class BackupDumperLoggerTest extends DumpTestCase {
                $this->assertLogItem( $this->logId1, "BackupDumperLogUserA",
                        $this->userId1, null, "type", "subtype", "PageA" );
 
-               $this->assertNotNull( $wgContLang, "Content language object validation" );
-               $namespace = $wgContLang->getNsText( NS_TALK );
+               $contLang = MediaWikiServices::getInstance()->getContentLanguage();
+               $this->assertNotNull( $contLang, "Content language object validation" );
+               $namespace = $contLang->getNsText( NS_TALK );
                $this->assertInternalType( 'string', $namespace );
                $this->assertGreaterThan( 0, strlen( $namespace ) );
                $this->assertLogItem( $this->logId2, "BackupDumperLogUserB",