Replace WikiPage::doEdit() usages
[lhc/web/wiklou.git] / tests / phpunit / includes / page / WikiPageTest.php
index 6d2b398..e55efee 100644 (file)
@@ -10,12 +10,12 @@ class WikiPageTest extends MediaWikiLangTestCase {
 
        protected $pages_to_delete;
 
 
        protected $pages_to_delete;
 
-       function __construct( $name = null, array $data = array(), $dataName = '' ) {
+       function __construct( $name = null, array $data = [], $dataName = '' ) {
                parent::__construct( $name, $data, $dataName );
 
                $this->tablesUsed = array_merge(
                        $this->tablesUsed,
                parent::__construct( $name, $data, $dataName );
 
                $this->tablesUsed = array_merge(
                        $this->tablesUsed,
-                       array( 'page',
+                       [ 'page',
                                'revision',
                                'text',
 
                                'revision',
                                'text',
 
@@ -29,12 +29,12 @@ class WikiPageTest extends MediaWikiLangTestCase {
                                'externallinks',
                                'imagelinks',
                                'templatelinks',
                                'externallinks',
                                'imagelinks',
                                'templatelinks',
-                               'iwlinks' ) );
+                               'iwlinks' ] );
        }
 
        protected function setUp() {
                parent::setUp();
        }
 
        protected function setUp() {
                parent::setUp();
-               $this->pages_to_delete = array();
+               $this->pages_to_delete = [];
 
                LinkCache::singleton()->clear(); # avoid cached redirect status, etc
        }
 
                LinkCache::singleton()->clear(); # avoid cached redirect status, etc
        }
@@ -115,7 +115,7 @@ class WikiPageTest extends MediaWikiLangTestCase {
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
-               $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) );
+               $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] );
                $n = $res->numRows();
                $res->free();
 
                $n = $res->numRows();
                $res->free();
 
@@ -145,7 +145,7 @@ class WikiPageTest extends MediaWikiLangTestCase {
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
-               $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) );
+               $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] );
                $n = $res->numRows();
                $res->free();
 
                $n = $res->numRows();
                $res->free();
 
@@ -154,6 +154,7 @@ class WikiPageTest extends MediaWikiLangTestCase {
 
        /**
         * @covers WikiPage::doEdit
 
        /**
         * @covers WikiPage::doEdit
+        * @deprecated since 1.21. Should be removed when WikiPage::doEdit() gets removed
         */
        public function testDoEdit() {
                $this->hideDeprecated( "WikiPage::doEdit" );
         */
        public function testDoEdit() {
                $this->hideDeprecated( "WikiPage::doEdit" );
@@ -179,7 +180,7 @@ class WikiPageTest extends MediaWikiLangTestCase {
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
-               $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) );
+               $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] );
                $n = $res->numRows();
                $res->free();
 
                $n = $res->numRows();
                $res->free();
 
@@ -205,7 +206,7 @@ class WikiPageTest extends MediaWikiLangTestCase {
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
-               $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) );
+               $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] );
                $n = $res->numRows();
                $res->free();
 
                $n = $res->numRows();
                $res->free();
 
@@ -276,12 +277,12 @@ class WikiPageTest extends MediaWikiLangTestCase {
                // Run the job queue
                JobQueueGroup::destroySingletons();
                $jobs = new RunJobs;
                // Run the job queue
                JobQueueGroup::destroySingletons();
                $jobs = new RunJobs;
-               $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null );
+               $jobs->loadParamsAndArgs( null, [ 'quiet' => true ], null );
                $jobs->execute();
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
                $jobs->execute();
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
-               $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) );
+               $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] );
                $n = $res->numRows();
                $res->free();
 
                $n = $res->numRows();
                $res->free();
 
@@ -300,18 +301,18 @@ class WikiPageTest extends MediaWikiLangTestCase {
                $id = $page->getId();
 
                // Similar to MovePage logic
                $id = $page->getId();
 
                // Similar to MovePage logic
-               wfGetDB( DB_MASTER )->delete( 'page', array( 'page_id' => $id ), __METHOD__ );
+               wfGetDB( DB_MASTER )->delete( 'page', [ 'page_id' => $id ], __METHOD__ );
                $page->doDeleteUpdates( $id );
 
                // Run the job queue
                JobQueueGroup::destroySingletons();
                $jobs = new RunJobs;
                $page->doDeleteUpdates( $id );
 
                // Run the job queue
                JobQueueGroup::destroySingletons();
                $jobs = new RunJobs;
-               $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null );
+               $jobs->loadParamsAndArgs( null, [ 'quiet' => true ], null );
                $jobs->execute();
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
                $jobs->execute();
 
                # ------------------------
                $dbr = wfGetDB( DB_SLAVE );
-               $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) );
+               $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] );
                $n = $res->numRows();
                $res->free();
 
                $n = $res->numRows();
                $res->free();
 
@@ -433,13 +434,13 @@ class WikiPageTest extends MediaWikiLangTestCase {
        }
 
        public static function provideHasViewableContent() {
        }
 
        public static function provideHasViewableContent() {
-               return array(
-                       array( 'WikiPageTest_testHasViewableContent', false, true ),
-                       array( 'Special:WikiPageTest_testHasViewableContent', false ),
-                       array( 'MediaWiki:WikiPageTest_testHasViewableContent', false ),
-                       array( 'Special:Userlogin', true ),
-                       array( 'MediaWiki:help', true ),
-               );
+               return [
+                       [ 'WikiPageTest_testHasViewableContent', false, true ],
+                       [ 'Special:WikiPageTest_testHasViewableContent', false ],
+                       [ 'MediaWiki:WikiPageTest_testHasViewableContent', false ],
+                       [ 'Special:Userlogin', true ],
+                       [ 'MediaWiki:help', true ],
+               ];
        }
 
        /**
        }
 
        /**
@@ -460,15 +461,15 @@ class WikiPageTest extends MediaWikiLangTestCase {
        }
 
        public static function provideGetRedirectTarget() {
        }
 
        public static function provideGetRedirectTarget() {
-               return array(
-                       array( 'WikiPageTest_testGetRedirectTarget_1', CONTENT_MODEL_WIKITEXT, "hello world", null ),
-                       array(
+               return [
+                       [ 'WikiPageTest_testGetRedirectTarget_1', CONTENT_MODEL_WIKITEXT, "hello world", null ],
+                       [
                                'WikiPageTest_testGetRedirectTarget_2',
                                CONTENT_MODEL_WIKITEXT,
                                "#REDIRECT [[hello world]]",
                                "Hello world"
                                'WikiPageTest_testGetRedirectTarget_2',
                                CONTENT_MODEL_WIKITEXT,
                                "#REDIRECT [[hello world]]",
                                "Hello world"
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
        }
 
        /**
@@ -476,9 +477,9 @@ class WikiPageTest extends MediaWikiLangTestCase {
         * @covers WikiPage::getRedirectTarget
         */
        public function testGetRedirectTarget( $title, $model, $text, $target ) {
         * @covers WikiPage::getRedirectTarget
         */
        public function testGetRedirectTarget( $title, $model, $text, $target ) {
-               $this->setMwGlobals( array(
+               $this->setMwGlobals( [
                        'wgCapitalLinks' => true,
                        'wgCapitalLinks' => true,
-               ) );
+               ] );
 
                $page = $this->createPage( $title, $text, $model );
 
 
                $page = $this->createPage( $title, $text, $model );
 
@@ -501,110 +502,110 @@ class WikiPageTest extends MediaWikiLangTestCase {
        }
 
        public static function provideIsCountable() {
        }
 
        public static function provideIsCountable() {
-               return array(
+               return [
 
                        // any
 
                        // any
-                       array( 'WikiPageTest_testIsCountable',
+                       [ 'WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                '',
                                'any',
                                true
                                CONTENT_MODEL_WIKITEXT,
                                '',
                                'any',
                                true
-                       ),
-                       array( 'WikiPageTest_testIsCountable',
+                       ],
+                       [ 'WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                'Foo',
                                'any',
                                true
                                CONTENT_MODEL_WIKITEXT,
                                'Foo',
                                'any',
                                true
-                       ),
+                       ],
 
                        // comma
 
                        // comma
-                       array( 'WikiPageTest_testIsCountable',
+                       [ 'WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                'Foo',
                                'comma',
                                false
                                CONTENT_MODEL_WIKITEXT,
                                'Foo',
                                'comma',
                                false
-                       ),
-                       array( 'WikiPageTest_testIsCountable',
+                       ],
+                       [ 'WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                'Foo, bar',
                                'comma',
                                true
                                CONTENT_MODEL_WIKITEXT,
                                'Foo, bar',
                                'comma',
                                true
-                       ),
+                       ],
 
                        // link
 
                        // link
-                       array( 'WikiPageTest_testIsCountable',
+                       [ 'WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                'Foo',
                                'link',
                                false
                                CONTENT_MODEL_WIKITEXT,
                                'Foo',
                                'link',
                                false
-                       ),
-                       array( 'WikiPageTest_testIsCountable',
+                       ],
+                       [ 'WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                'Foo [[bar]]',
                                'link',
                                true
                                CONTENT_MODEL_WIKITEXT,
                                'Foo [[bar]]',
                                'link',
                                true
-                       ),
+                       ],
 
                        // redirects
 
                        // redirects
-                       array( 'WikiPageTest_testIsCountable',
+                       [ 'WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                '#REDIRECT [[bar]]',
                                'any',
                                false
                                CONTENT_MODEL_WIKITEXT,
                                '#REDIRECT [[bar]]',
                                'any',
                                false
-                       ),
-                       array( 'WikiPageTest_testIsCountable',
+                       ],
+                       [ 'WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                '#REDIRECT [[bar]]',
                                'comma',
                                false
                                CONTENT_MODEL_WIKITEXT,
                                '#REDIRECT [[bar]]',
                                'comma',
                                false
-                       ),
-                       array( 'WikiPageTest_testIsCountable',
+                       ],
+                       [ 'WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                '#REDIRECT [[bar]]',
                                'link',
                                false
                                CONTENT_MODEL_WIKITEXT,
                                '#REDIRECT [[bar]]',
                                'link',
                                false
-                       ),
+                       ],
 
                        // not a content namespace
 
                        // not a content namespace
-                       array( 'Talk:WikiPageTest_testIsCountable',
+                       [ 'Talk:WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                'Foo',
                                'any',
                                false
                                CONTENT_MODEL_WIKITEXT,
                                'Foo',
                                'any',
                                false
-                       ),
-                       array( 'Talk:WikiPageTest_testIsCountable',
+                       ],
+                       [ 'Talk:WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                'Foo, bar',
                                'comma',
                                false
                                CONTENT_MODEL_WIKITEXT,
                                'Foo, bar',
                                'comma',
                                false
-                       ),
-                       array( 'Talk:WikiPageTest_testIsCountable',
+                       ],
+                       [ 'Talk:WikiPageTest_testIsCountable',
                                CONTENT_MODEL_WIKITEXT,
                                'Foo [[bar]]',
                                'link',
                                false
                                CONTENT_MODEL_WIKITEXT,
                                'Foo [[bar]]',
                                'link',
                                false
-                       ),
+                       ],
 
                        // not a content namespace, different model
 
                        // not a content namespace, different model
-                       array( 'MediaWiki:WikiPageTest_testIsCountable.js',
+                       [ 'MediaWiki:WikiPageTest_testIsCountable.js',
                                null,
                                'Foo',
                                'any',
                                false
                                null,
                                'Foo',
                                'any',
                                false
-                       ),
-                       array( 'MediaWiki:WikiPageTest_testIsCountable.js',
+                       ],
+                       [ 'MediaWiki:WikiPageTest_testIsCountable.js',
                                null,
                                'Foo, bar',
                                'comma',
                                false
                                null,
                                'Foo, bar',
                                'comma',
                                false
-                       ),
-                       array( 'MediaWiki:WikiPageTest_testIsCountable.js',
+                       ],
+                       [ 'MediaWiki:WikiPageTest_testIsCountable.js',
                                null,
                                'Foo [[bar]]',
                                'link',
                                false
                                null,
                                'Foo [[bar]]',
                                'link',
                                false
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
        }
 
        /**
@@ -651,10 +652,10 @@ class WikiPageTest extends MediaWikiLangTestCase {
        }
 
        public static function provideGetParserOutput() {
        }
 
        public static function provideGetParserOutput() {
-               return array(
-                       array( CONTENT_MODEL_WIKITEXT, "hello ''world''\n", "<p>hello <i>world</i></p>" ),
+               return [
+                       [ CONTENT_MODEL_WIKITEXT, "hello ''world''\n", "<p>hello <i>world</i></p>" ],
                        // @todo more...?
                        // @todo more...?
-               );
+               ];
        }
 
        /**
        }
 
        /**
@@ -721,24 +722,24 @@ more stuff
 
        public function dataReplaceSection() {
                // NOTE: assume the Help namespace to contain wikitext
 
        public function dataReplaceSection() {
                // NOTE: assume the Help namespace to contain wikitext
-               return array(
-                       array( 'Help:WikiPageTest_testReplaceSection',
+               return [
+                       [ 'Help:WikiPageTest_testReplaceSection',
                                CONTENT_MODEL_WIKITEXT,
                                WikiPageTest::$sections,
                                "0",
                                "No more",
                                null,
                                trim( preg_replace( '/^Intro/sm', 'No more', WikiPageTest::$sections ) )
                                CONTENT_MODEL_WIKITEXT,
                                WikiPageTest::$sections,
                                "0",
                                "No more",
                                null,
                                trim( preg_replace( '/^Intro/sm', 'No more', WikiPageTest::$sections ) )
-                       ),
-                       array( 'Help:WikiPageTest_testReplaceSection',
+                       ],
+                       [ 'Help:WikiPageTest_testReplaceSection',
                                CONTENT_MODEL_WIKITEXT,
                                WikiPageTest::$sections,
                                "",
                                "No more",
                                null,
                                "No more"
                                CONTENT_MODEL_WIKITEXT,
                                WikiPageTest::$sections,
                                "",
                                "No more",
                                null,
                                "No more"
-                       ),
-                       array( 'Help:WikiPageTest_testReplaceSection',
+                       ],
+                       [ 'Help:WikiPageTest_testReplaceSection',
                                CONTENT_MODEL_WIKITEXT,
                                WikiPageTest::$sections,
                                "2",
                                CONTENT_MODEL_WIKITEXT,
                                WikiPageTest::$sections,
                                "2",
@@ -747,40 +748,24 @@ more stuff
                                trim( preg_replace( '/^== test ==.*== foo ==/sm',
                                        "== TEST ==\nmore fun\n\n== foo ==",
                                        WikiPageTest::$sections ) )
                                trim( preg_replace( '/^== test ==.*== foo ==/sm',
                                        "== TEST ==\nmore fun\n\n== foo ==",
                                        WikiPageTest::$sections ) )
-                       ),
-                       array( 'Help:WikiPageTest_testReplaceSection',
+                       ],
+                       [ 'Help:WikiPageTest_testReplaceSection',
                                CONTENT_MODEL_WIKITEXT,
                                WikiPageTest::$sections,
                                "8",
                                "No more",
                                null,
                                trim( WikiPageTest::$sections )
                                CONTENT_MODEL_WIKITEXT,
                                WikiPageTest::$sections,
                                "8",
                                "No more",
                                null,
                                trim( WikiPageTest::$sections )
-                       ),
-                       array( 'Help:WikiPageTest_testReplaceSection',
+                       ],
+                       [ 'Help:WikiPageTest_testReplaceSection',
                                CONTENT_MODEL_WIKITEXT,
                                WikiPageTest::$sections,
                                "new",
                                "No more",
                                "New",
                                trim( WikiPageTest::$sections ) . "\n\n== New ==\n\nNo more"
                                CONTENT_MODEL_WIKITEXT,
                                WikiPageTest::$sections,
                                "new",
                                "No more",
                                "New",
                                trim( WikiPageTest::$sections ) . "\n\n== New ==\n\nNo more"
-                       ),
-               );
-       }
-
-       /**
-        * @dataProvider dataReplaceSection
-        * @covers WikiPage::replaceSection
-        */
-       public function testReplaceSection( $title, $model, $text, $section, $with,
-               $sectionTitle, $expected
-       ) {
-               $this->hideDeprecated( "WikiPage::replaceSection" );
-
-               $page = $this->createPage( $title, $text, $model );
-               $text = $page->replaceSection( $section, $with, $sectionTitle );
-               $text = trim( $text );
-
-               $this->assertEquals( $expected, $text );
+                       ],
+               ];
        }
 
        /**
        }
 
        /**
@@ -917,7 +902,7 @@ more stuff
                # now, try the actual rollback
                $admin->addGroup( "sysop" ); # XXX: make the test user a sysop...
                $token = $admin->getEditToken(
                # now, try the actual rollback
                $admin->addGroup( "sysop" ); # XXX: make the test user a sysop...
                $token = $admin->getEditToken(
-                       array( $page->getTitle()->getPrefixedText(), $user2->getName() ),
+                       [ $page->getTitle()->getPrefixedText(), $user2->getName() ],
                        null
                );
                $errors = $page->doRollback(
                        null
                );
                $errors = $page->doRollback(
@@ -974,7 +959,7 @@ more stuff
                # now, try the rollback
                $admin->addGroup( "sysop" ); # XXX: make the test user a sysop...
                $token = $admin->getEditToken(
                # now, try the rollback
                $admin->addGroup( "sysop" ); # XXX: make the test user a sysop...
                $token = $admin->getEditToken(
-                       array( $page->getTitle()->getPrefixedText(), $user1->getName() ),
+                       [ $page->getTitle()->getPrefixedText(), $user1->getName() ],
                        null
                );
                $errors = $page->doRollback(
                        null
                );
                $errors = $page->doRollback(
@@ -1030,9 +1015,9 @@ more stuff
                );
 
                # now, do a the rollback from the same user was doing the edit before
                );
 
                # now, do a the rollback from the same user was doing the edit before
-               $resultDetails = array();
+               $resultDetails = [];
                $token = $user1->getEditToken(
                $token = $user1->getEditToken(
-                       array( $page->getTitle()->getPrefixedText(), $user1->getName() ),
+                       [ $page->getTitle()->getPrefixedText(), $user1->getName() ],
                        null
                );
                $errors = $page->doRollback(
                        null
                );
                $errors = $page->doRollback(
@@ -1044,12 +1029,12 @@ more stuff
                        $admin
                );
 
                        $admin
                );
 
-               $this->assertEquals( array(), $errors, "Rollback failed same user" );
+               $this->assertEquals( [], $errors, "Rollback failed same user" );
 
                # now, try the rollback
 
                # now, try the rollback
-               $resultDetails = array();
+               $resultDetails = [];
                $token = $admin->getEditToken(
                $token = $admin->getEditToken(
-                       array( $page->getTitle()->getPrefixedText(), $user1->getName() ),
+                       [ $page->getTitle()->getPrefixedText(), $user1->getName() ],
                        null
                );
                $errors = $page->doRollback(
                        null
                );
                $errors = $page->doRollback(
@@ -1061,8 +1046,8 @@ more stuff
                        $admin
                );
 
                        $admin
                );
 
-               $this->assertEquals( array( array( 'alreadyrolled', 'WikiPageTest testDoRollback',
-                       '127.0.1.11', 'Admin' ) ), $errors, "Rollback not failed" );
+               $this->assertEquals( [ [ 'alreadyrolled', 'WikiPageTest testDoRollback',
+                       '127.0.1.11', 'Admin' ] ], $errors, "Rollback not failed" );
 
                $page = new WikiPage( $page->getTitle() );
                $this->assertEquals( $rev1->getSha1(), $page->getRevision()->getSha1(),
 
                $page = new WikiPage( $page->getTitle() );
                $this->assertEquals( $rev1->getSha1(), $page->getRevision()->getSha1(),
@@ -1071,29 +1056,29 @@ more stuff
        }
 
        public static function provideGetAutosummary() {
        }
 
        public static function provideGetAutosummary() {
-               return array(
-                       array(
+               return [
+                       [
                                'Hello there, world!',
                                '#REDIRECT [[Foo]]',
                                0,
                                '/^Redirected page .*Foo/'
                                'Hello there, world!',
                                '#REDIRECT [[Foo]]',
                                0,
                                '/^Redirected page .*Foo/'
-                       ),
+                       ],
 
 
-                       array(
+                       [
                                null,
                                'Hello world!',
                                EDIT_NEW,
                                '/^Created page .*Hello/'
                                null,
                                'Hello world!',
                                EDIT_NEW,
                                '/^Created page .*Hello/'
-                       ),
+                       ],
 
 
-                       array(
+                       [
                                'Hello there, world!',
                                '',
                                0,
                                '/^Blanked/'
                                'Hello there, world!',
                                '',
                                0,
                                '/^Blanked/'
-                       ),
+                       ],
 
 
-                       array(
+                       [
                                'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
                                eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
                                voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
                                'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
                                eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
                                voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
@@ -1101,15 +1086,15 @@ more stuff
                                'Hello world!',
                                0,
                                '/^Replaced .*Hello/'
                                'Hello world!',
                                0,
                                '/^Replaced .*Hello/'
-                       ),
+                       ],
 
 
-                       array(
+                       [
                                'foo',
                                'bar',
                                0,
                                '/^$/'
                                'foo',
                                'bar',
                                0,
                                '/^$/'
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
        }
 
        /**
@@ -1128,42 +1113,42 @@ more stuff
        }
 
        public static function provideGetAutoDeleteReason() {
        }
 
        public static function provideGetAutoDeleteReason() {
-               return array(
-                       array(
-                               array(),
+               return [
+                       [
+                               [],
                                false,
                                false
                                false,
                                false
-                       ),
+                       ],
 
 
-                       array(
-                               array(
-                                       array( "first edit", null ),
-                               ),
+                       [
+                               [
+                                       [ "first edit", null ],
+                               ],
                                "/first edit.*only contributor/",
                                false
                                "/first edit.*only contributor/",
                                false
-                       ),
+                       ],
 
 
-                       array(
-                               array(
-                                       array( "first edit", null ),
-                                       array( "second edit", null ),
-                               ),
+                       [
+                               [
+                                       [ "first edit", null ],
+                                       [ "second edit", null ],
+                               ],
                                "/second edit.*only contributor/",
                                true
                                "/second edit.*only contributor/",
                                true
-                       ),
+                       ],
 
 
-                       array(
-                               array(
-                                       array( "first edit", "127.0.2.22" ),
-                                       array( "second edit", "127.0.3.33" ),
-                               ),
+                       [
+                               [
+                                       [ "first edit", "127.0.2.22" ],
+                                       [ "second edit", "127.0.3.33" ],
+                               ],
                                "/second edit/",
                                true
                                "/second edit/",
                                true
-                       ),
+                       ],
 
 
-                       array(
-                               array(
-                                       array(
+                       [
+                               [
+                                       [
                                                "first edit: "
                                                        . "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam "
                                                        . " nonumy eirmod tempor invidunt ut labore et dolore magna "
                                                "first edit: "
                                                        . "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam "
                                                        . " nonumy eirmod tempor invidunt ut labore et dolore magna "
@@ -1171,22 +1156,22 @@ more stuff
                                                        . "et justo duo dolores et ea rebum. Stet clita kasd gubergren, "
                                                        . "no sea  takimata sanctus est Lorem ipsum dolor sit amet.'",
                                                null
                                                        . "et justo duo dolores et ea rebum. Stet clita kasd gubergren, "
                                                        . "no sea  takimata sanctus est Lorem ipsum dolor sit amet.'",
                                                null
-                                       ),
-                               ),
+                                       ],
+                               ],
                                '/first edit:.*\.\.\."/',
                                false
                                '/first edit:.*\.\.\."/',
                                false
-                       ),
+                       ],
 
 
-                       array(
-                               array(
-                                       array( "first edit", "127.0.2.22" ),
-                                       array( "", "127.0.3.33" ),
-                               ),
+                       [
+                               [
+                                       [ "first edit", "127.0.2.22" ],
+                                       [ "", "127.0.3.33" ],
+                               ],
                                "/before blanking.*first edit/",
                                true
                                "/before blanking.*first edit/",
                                true
-                       ),
+                       ],
 
 
-               );
+               ];
        }
 
        /**
        }
 
        /**
@@ -1233,14 +1218,14 @@ more stuff
        }
 
        public static function providePreSaveTransform() {
        }
 
        public static function providePreSaveTransform() {
-               return array(
-                       array( 'hello this is ~~~',
+               return [
+                       [ 'hello this is ~~~',
                                "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]",
                                "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]",
-                       ),
-                       array( 'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
+                       ],
+                       [ 'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
                                'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
                                'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
        }
 
        /**