dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mass conversion of $wgContLang to service
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
ExportTest.php
diff --git
a/tests/phpunit/includes/ExportTest.php
b/tests/phpunit/includes/ExportTest.php
index
c077081
..
af10b9c
100644
(file)
--- a/
tests/phpunit/includes/ExportTest.php
+++ b/
tests/phpunit/includes/ExportTest.php
@@
-1,5
+1,7
@@
<?php
<?php
+use MediaWiki\MediaWikiServices;
+
/**
* Test class for Export methods.
*
/**
* Test class for Export methods.
*
@@
-20,7
+22,6
@@
class ExportTest extends MediaWikiLangTestCase {
* @covers WikiExporter::pageByTitle
*/
public function testPageByTitle() {
* @covers WikiExporter::pageByTitle
*/
public function testPageByTitle() {
- global $wgContLang;
$pageTitle = 'UTPage';
$exporter = new WikiExporter(
$pageTitle = 'UTPage';
$exporter = new WikiExporter(
@@
-35,10
+36,9
@@
class ExportTest extends MediaWikiLangTestCase {
$exporter->openStream();
$exporter->pageByTitle( $title );
$exporter->closeStream();
$exporter->openStream();
$exporter->pageByTitle( $title );
$exporter->closeStream();
- $xmlString = $sink->getOutput();
// This throws error if invalid xml output
// This throws error if invalid xml output
- $xmlObject = simplexml_load_string( $
xmlString
);
+ $xmlObject = simplexml_load_string( $
sink
);
/**
* Check namespaces match xml
/**
* 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 );
$actualNamespaces = array_values( $actualNamespaces );
$this->assertEquals( $actualNamespaces, $xmlNamespaces );