Merge "Change php extract() to explicit code"
[lhc/web/wiklou.git] / tests / phpunit / includes / jobqueue / RefreshLinksPartitionTest.php
index 3e232a9..f874f6d 100644 (file)
@@ -6,7 +6,7 @@
  * @group Database
  */
 class RefreshLinksPartitionTest extends MediaWikiTestCase {
-       public function __construct( $name = null, array $data = array(), $dataName = '' ) {
+       public function __construct( $name = null, array $data = [], $dataName = '' ) {
                parent::__construct( $name, $data, $dataName );
 
                $this->tablesUsed[] = 'page';
@@ -16,6 +16,7 @@ class RefreshLinksPartitionTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provider_backlinks
+        * @covers BacklinkJobUtils::partitionBacklinkJob
         */
        public function testRefreshLinks( $ns, $dbKey, $pages ) {
                $title = Title::makeTitle( $ns, $dbKey );
@@ -34,10 +35,10 @@ class RefreshLinksPartitionTest extends MediaWikiTestCase {
                        'Correct number of backlinks'
                );
 
-               $job = new RefreshLinksJob( $title, array( 'recursive' => true, 'table' => 'pagelinks' )
+               $job = new RefreshLinksJob( $title, [ 'recursive' => true, 'table' => 'pagelinks' ]
                        + Job::newRootJobParams( "refreshlinks:pagelinks:{$title->getPrefixedText()}" ) );
                $extraParams = $job->getRootJobParams();
-               $jobs = BacklinkJobUtils::partitionBacklinkJob( $job, 9, 1, array( 'params' => $extraParams ) );
+               $jobs = BacklinkJobUtils::partitionBacklinkJob( $job, 9, 1, [ 'params' => $extraParams ] );
 
                $this->assertEquals( 10, count( $jobs ), 'Correct number of sub-jobs' );
                $this->assertEquals( $pages[0], current( $jobs[0]->params['pages'] ),
@@ -63,7 +64,7 @@ class RefreshLinksPartitionTest extends MediaWikiTestCase {
                        $jobs[9],
                        9,
                        1,
-                       array( 'params' => $extraParams )
+                       [ 'params' => $extraParams ]
                );
 
                $this->assertEquals( 10, count( $jobs2 ), 'Correct number of sub-jobs' );
@@ -86,7 +87,7 @@ class RefreshLinksPartitionTest extends MediaWikiTestCase {
                        $jobs2[9],
                        9,
                        1,
-                       array( 'params' => $extraParams )
+                       [ 'params' => $extraParams ]
                );
 
                $this->assertEquals( 2, count( $jobs3 ), 'Correct number of sub-jobs' );
@@ -101,12 +102,12 @@ class RefreshLinksPartitionTest extends MediaWikiTestCase {
        }
 
        public static function provider_backlinks() {
-               $pages = array();
+               $pages = [];
                for ( $i = 0; $i < 20; ++$i ) {
-                       $pages[] = array( 0, "Page-$i" );
+                       $pages[] = [ 0, "Page-$i" ];
                }
-               return array(
-                       array( 10, 'Bang', $pages )
-               );
+               return [
+                       [ 10, 'Bang', $pages ]
+               ];
        }
 }