Convert all array() syntax to []
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / TagHooksTest.php
index 3605e50..2a4a4ec 100644 (file)
@@ -6,23 +6,17 @@
  */
 class TagHookTest extends MediaWikiTestCase {
        public static function provideValidNames() {
-               return array(
-                       array( 'foo' ),
-                       array( 'foo-bar' ),
-                       array( 'foo_bar' ),
-                       array( 'FOO-BAR' ),
-                       array( 'foo bar' )
-               );
+               return [
+                       [ 'foo' ],
+                       [ 'foo-bar' ],
+                       [ 'foo_bar' ],
+                       [ 'FOO-BAR' ],
+                       [ 'foo bar' ]
+               ];
        }
 
        public static function provideBadNames() {
-               return array( array( "foo<bar" ), array( "foo>bar" ), array( "foo\nbar" ), array( "foo\rbar" ) );
-       }
-
-       protected function setUp() {
-               parent::setUp();
-
-               $this->setMwGlobals( 'wgAlwaysUseTidy', false );
+               return [ [ "foo<bar" ], [ "foo>bar" ], [ "foo\nbar" ], [ "foo\rbar" ] ];
        }
 
        /**
@@ -33,7 +27,7 @@ class TagHookTest extends MediaWikiTestCase {
                global $wgParserConf, $wgContLang;
                $parser = new Parser( $wgParserConf );
 
-               $parser->setHook( $tag, array( $this, 'tagCallback' ) );
+               $parser->setHook( $tag, [ $this, 'tagCallback' ] );
                $parserOutput = $parser->parse(
                        "Foo<$tag>Bar</$tag>Baz",
                        Title::newFromText( 'Test' ),
@@ -53,7 +47,7 @@ class TagHookTest extends MediaWikiTestCase {
                global $wgParserConf, $wgContLang;
                $parser = new Parser( $wgParserConf );
 
-               $parser->setHook( $tag, array( $this, 'tagCallback' ) );
+               $parser->setHook( $tag, [ $this, 'tagCallback' ] );
                $parser->parse(
                        "Foo<$tag>Bar</$tag>Baz",
                        Title::newFromText( 'Test' ),
@@ -70,7 +64,7 @@ class TagHookTest extends MediaWikiTestCase {
                global $wgParserConf, $wgContLang;
                $parser = new Parser( $wgParserConf );
 
-               $parser->setFunctionTagHook( $tag, array( $this, 'functionTagCallback' ), 0 );
+               $parser->setFunctionTagHook( $tag, [ $this, 'functionTagCallback' ], 0 );
                $parserOutput = $parser->parse(
                        "Foo<$tag>Bar</$tag>Baz",
                        Title::newFromText( 'Test' ),
@@ -90,7 +84,11 @@ class TagHookTest extends MediaWikiTestCase {
                global $wgParserConf, $wgContLang;
                $parser = new Parser( $wgParserConf );
 
-               $parser->setFunctionTagHook( $tag, array( $this, 'functionTagCallback' ), Parser::SFH_OBJECT_ARGS );
+               $parser->setFunctionTagHook(
+                       $tag,
+                       [ $this, 'functionTagCallback' ],
+                       Parser::SFH_OBJECT_ARGS
+               );
                $parser->parse(
                        "Foo<$tag>Bar</$tag>Baz",
                        Title::newFromText( 'Test' ),