Merge "Delete autoload.ide.php"
[lhc/web/wiklou.git] / tests / phpunit / maintenance / backup_LogTest.php
index 0019a3f..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
  *
@@ -104,7 +114,6 @@ class BackupDumperLoggerTest extends DumpTestCase {
        private function assertLogItem( $id, $user_name, $user_id, $comment, $type,
                $subtype, $title, $parameters = []
        ) {
-
                $this->assertNodeStart( "logitem" );
                $this->skipWhitespace();
 
@@ -137,8 +146,6 @@ class BackupDumperLoggerTest extends DumpTestCase {
        }
 
        function testPlain() {
-               global $wgContLang;
-
                // Preparing the dump
                $fname = $this->getNewTempFile();
 
@@ -157,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",
@@ -173,8 +181,6 @@ class BackupDumperLoggerTest extends DumpTestCase {
        }
 
        function testXmlDumpsBackupUseCaseLogging() {
-               global $wgContLang;
-
                $this->checkHasGzip();
 
                // Preparing the dump
@@ -210,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",