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
Remove FSRepo
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
ExtraParserTest.php
diff --git
a/tests/phpunit/includes/ExtraParserTest.php
b/tests/phpunit/includes/ExtraParserTest.php
index
77b26b3
..
5dd4f7a
100644
(file)
--- a/
tests/phpunit/includes/ExtraParserTest.php
+++ b/
tests/phpunit/includes/ExtraParserTest.php
@@
-16,18
+16,16
@@
class ExtraParserTest extends MediaWikiTestCase {
parent::setUp();
$contLang = Language::factory( 'en' );
parent::setUp();
$contLang = Language::factory( 'en' );
- $this->setMwGlobals(
array(
+ $this->setMwGlobals(
[
'wgShowDBErrorBacktrace' => true,
'wgShowDBErrorBacktrace' => true,
- 'wgLanguageCode' => 'en',
- 'wgContLang' => $contLang,
- 'wgLang' => Language::factory( 'en' ),
- 'wgMemc' => new EmptyBagOStuff,
- 'wgAlwaysUseTidy' => false,
'wgCleanSignatures' => true,
'wgCleanSignatures' => true,
- ) );
+ ] );
+ $this->setUserLang( 'en' );
+ $this->setContentLang( $contLang );
+ // FIXME: This test should pass without setting global content language
$this->options = ParserOptions::newFromUserAndLang( new User, $contLang );
$this->options = ParserOptions::newFromUserAndLang( new User, $contLang );
- $this->options->setTemplateCallback(
array( __CLASS__, 'statelessFetchTemplate' )
);
+ $this->options->setTemplateCallback(
[ __CLASS__, 'statelessFetchTemplate' ]
);
$this->parser = new Parser;
MagicWord::clearCache();
$this->parser = new Parser;
MagicWord::clearCache();
@@
-121,11
+119,11
@@
class ExtraParserTest extends MediaWikiTestCase {
}
public static function provideStringsForCleanSigInSig() {
}
public static function provideStringsForCleanSigInSig() {
- return
array(
-
array( "{{Foo}} ~~~~", "{{Foo}} " )
,
-
array( "~~~", "" )
,
-
array( "~~~~~", "" )
,
-
)
;
+ return
[
+
[ "{{Foo}} ~~~~", "{{Foo}} " ]
,
+
[ "~~~", "" ]
,
+
[ "~~~~~", "" ]
,
+
]
;
}
/**
}
/**
@@
-184,12
+182,12
@@
class ExtraParserTest extends MediaWikiTestCase {
*/
static function statelessFetchTemplate( $title, $parser = false ) {
$text = "Content of ''" . $title->getFullText() . "''";
*/
static function statelessFetchTemplate( $title, $parser = false ) {
$text = "Content of ''" . $title->getFullText() . "''";
- $deps =
array()
;
+ $deps =
[]
;
- return
array(
+ return
[
'text' => $text,
'finalTitle' => $title,
'text' => $text,
'finalTitle' => $title,
- 'deps' => $deps
)
;
+ 'deps' => $deps
]
;
}
/**
}
/**
@@
-200,7
+198,7
@@
class ExtraParserTest extends MediaWikiTestCase {
$title = Title::newFromText( __FUNCTION__ );
$catName = wfMessage( 'broken-file-category' )->inContentLanguage()->text();
$cat = Title::makeTitleSafe( NS_CATEGORY, $catName );
$title = Title::newFromText( __FUNCTION__ );
$catName = wfMessage( 'broken-file-category' )->inContentLanguage()->text();
$cat = Title::makeTitleSafe( NS_CATEGORY, $catName );
- $expected =
array( $cat->getDBkey() )
;
+ $expected =
[ $cat->getDBkey() ]
;
$parserOutput = $this->parser->parse( "[[file:nonexistent]]", $title, $this->options );
$result = $parserOutput->getCategoryLinks();
$this->assertEquals( $expected, $result );
$parserOutput = $this->parser->parse( "[[file:nonexistent]]", $title, $this->options );
$result = $parserOutput->getCategoryLinks();
$this->assertEquals( $expected, $result );