$user = new User();
$user->setName( '127.0.0.1' );
- $this->setMwGlobals( array(
+ $this->setMwGlobals( [
'wgUser' => $user,
- 'wgTextModelsToParse' => array(
+ 'wgTextModelsToParse' => [
CONTENT_MODEL_CSS,
- )
- ) );
+ ]
+ ] );
}
public function newContent( $text ) {
}
public static function dataGetParserOutput() {
- return array(
- array(
+ return [
+ [
'MediaWiki:Test.css',
null,
"hello <world>\n",
"<pre class=\"mw-code mw-css\" dir=\"ltr\">\nhello <world>\n\n</pre>"
- ),
- array(
+ ],
+ [
'MediaWiki:Test.css',
null,
"/* hello [[world]] */\n",
"<pre class=\"mw-code mw-css\" dir=\"ltr\">\n/* hello [[world]] */\n\n</pre>",
- array(
- 'Links' => array(
- array( 'World' => 0 )
- )
- )
- ),
+ [
+ 'Links' => [
+ [ 'World' => 0 ]
+ ]
+ ]
+ ],
// TODO: more...?
- );
+ ];
}
/**
* Redirects aren't supported
*/
public static function provideUpdateRedirect() {
- return array(
- array(
+ return [
+ [
'#REDIRECT [[Someplace]]',
'#REDIRECT [[Someplace]]',
- ),
- );
+ ],
+ ];
}
/**
+ * @covers CssContent::getRedirectTarget
* @dataProvider provideGetRedirectTarget
*/
public function testGetRedirectTarget( $title, $text ) {
- $this->setMwGlobals( array(
+ $this->setMwGlobals( [
'wgServer' => '//example.org',
'wgScriptPath' => '/w',
'wgScript' => '/w/index.php',
- ) );
+ ] );
$content = new CssContent( $text );
$target = $content->getRedirectTarget();
$this->assertEquals( $title, $target ? $target->getPrefixedText() : null );
*/
public static function provideGetRedirectTarget() {
// @codingStandardsIgnoreStart Generic.Files.LineLength
- return array(
- array( 'MediaWiki:MonoBook.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=MediaWiki:MonoBook.css&action=raw&ctype=text/css);" ),
- array( 'User:FooBar/common.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=User:FooBar/common.css&action=raw&ctype=text/css);" ),
- array( 'Gadget:FooBaz.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=Gadget:FooBaz.css&action=raw&ctype=text/css);" ),
+ return [
+ [ 'MediaWiki:MonoBook.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=MediaWiki:MonoBook.css&action=raw&ctype=text/css);" ],
+ [ 'User:FooBar/common.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=User:FooBar/common.css&action=raw&ctype=text/css);" ],
+ [ 'Gadget:FooBaz.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=Gadget:FooBaz.css&action=raw&ctype=text/css);" ],
# No #REDIRECT comment
- array( null, "@import url(//example.org/w/index.php?title=Gadget:FooBaz.css&action=raw&ctype=text/css);" ),
+ [ null, "@import url(//example.org/w/index.php?title=Gadget:FooBaz.css&action=raw&ctype=text/css);" ],
# Wrong domain
- array( null, "/* #REDIRECT */@import url(//example.com/w/index.php?title=Gadget:FooBaz.css&action=raw&ctype=text/css);" ),
- );
+ [ null, "/* #REDIRECT */@import url(//example.com/w/index.php?title=Gadget:FooBaz.css&action=raw&ctype=text/css);" ],
+ ];
// @codingStandardsIgnoreEnd
}
public static function dataEquals() {
- return array(
- array( new CssContent( 'hallo' ), null, false ),
- array( new CssContent( 'hallo' ), new CssContent( 'hallo' ), true ),
- array( new CssContent( 'hallo' ), new WikitextContent( 'hallo' ), false ),
- array( new CssContent( 'hallo' ), new CssContent( 'HALLO' ), false ),
- );
+ return [
+ [ new CssContent( 'hallo' ), null, false ],
+ [ new CssContent( 'hallo' ), new CssContent( 'hallo' ), true ],
+ [ new CssContent( 'hallo' ), new WikitextContent( 'hallo' ), false ],
+ [ new CssContent( 'hallo' ), new CssContent( 'HALLO' ), false ],
+ ];
}
/**