Merge "resourceloader: Soft-deprecate use of global LESS variables"
[lhc/web/wiklou.git] / tests / phpunit / includes / content / CssContentTest.php
index 59bfb03..d2078d7 100644 (file)
@@ -16,12 +16,12 @@ class CssContentTest extends JavaScriptContentTest {
                $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 ) {
@@ -29,27 +29,27 @@ class CssContentTest extends JavaScriptContentTest {
        }
 
        public static function dataGetParserOutput() {
-               return array(
-                       array(
+               return [
+                       [
                                'MediaWiki:Test.css',
                                null,
                                "hello <world>\n",
                                "<pre class=\"mw-code mw-css\" dir=\"ltr\">\nhello &lt;world&gt;\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...?
-               );
+               ];
        }
 
        /**
@@ -74,23 +74,23 @@ class CssContentTest extends JavaScriptContentTest {
         * Redirects aren't supported
         */
        public static function provideUpdateRedirect() {
-               return array(
-                       array(
+               return [
+                       [
                                '#REDIRECT [[Someplace]]',
                                '#REDIRECT [[Someplace]]',
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
         * @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 );
@@ -100,24 +100,26 @@ class CssContentTest extends JavaScriptContentTest {
         * Keep this in sync with CssContentHandlerTest::provideMakeRedirectContent()
         */
        public static function provideGetRedirectTarget() {
-               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);" ),
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
+               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 ],
+               ];
        }
 
        /**