CommentStore: Hard-deprecate newKey()
[lhc/web/wiklou.git] / tests / phpunit / includes / ExportTest.php
index c077081..af10b9c 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Test class for Export methods.
  *
@@ -20,7 +22,6 @@ class ExportTest extends MediaWikiLangTestCase {
         * @covers WikiExporter::pageByTitle
         */
        public function testPageByTitle() {
-               global $wgContLang;
                $pageTitle = 'UTPage';
 
                $exporter = new WikiExporter(
@@ -35,10 +36,9 @@ class ExportTest extends MediaWikiLangTestCase {
                $exporter->openStream();
                $exporter->pageByTitle( $title );
                $exporter->closeStream();
-               $xmlString = $sink->getOutput();
 
                // This throws error if invalid xml output
-               $xmlObject = simplexml_load_string( $xmlString );
+               $xmlObject = simplexml_load_string( $sink );
 
                /**
                 * Check namespaces match xml
@@ -52,7 +52,8 @@ class ExportTest extends MediaWikiLangTestCase {
                        }
                }
 
-               $actualNamespaces = (array)$wgContLang->getNamespaces();
+               $actualNamespaces = (array)MediaWikiServices::getInstance()->getContentLanguage()->
+                       getNamespaces();
                $actualNamespaces = array_values( $actualNamespaces );
                $this->assertEquals( $actualNamespaces, $xmlNamespaces );