<?php
+use MediaWiki\MediaWikiServices;
+
/**
* Test class for Export methods.
*
* @covers WikiExporter::pageByTitle
*/
public function testPageByTitle() {
- global $wgContLang;
$pageTitle = 'UTPage';
$exporter = new WikiExporter(
$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
}
}
- $actualNamespaces = (array)$wgContLang->getNamespaces();
+ $actualNamespaces = (array)MediaWikiServices::getInstance()->getContentLanguage()->
+ getNamespaces();
$actualNamespaces = array_values( $actualNamespaces );
$this->assertEquals( $actualNamespaces, $xmlNamespaces );