build: Updating mediawiki/mediawiki-codesniffer to 17.0.0
[lhc/web/wiklou.git] / tests / phpunit / includes / api / query / ApiQueryContinueTest.php
index d441f4c..7259bb8 100644 (file)
@@ -33,9 +33,10 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
 
        /**
         * Create a set of pages. These must not change, otherwise the tests might give wrong results.
-        * @see MediaWikiTestCase::addDBData()
+        *
+*@see MediaWikiTestCase::addDBDataOnce()
         */
-       function addDBData() {
+       function addDBDataOnce() {
                try {
                        $this->editPage( 'Template:AQCT-T1', '**Template:AQCT-T1**' );
                        $this->editPage( 'Template:AQCT-T2', '**Template:AQCT-T2**' );
@@ -55,19 +56,19 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
 
        /**
         * Test smart continue - list=allpages
-        * @medium
+        * @group medium
         */
        public function test1List() {
                $this->mVerbose = false;
                $mk = function ( $l ) {
-                       return array(
+                       return [
                                'list' => 'allpages',
                                'apprefix' => 'AQCT-',
                                'aplimit' => "$l",
-                       );
+                       ];
                };
                $data = $this->query( $mk( 99 ), 1, '1L', false ) +
-                       array( 'batchcomplete' => true );
+                       [ 'batchcomplete' => true ];
 
                // 1 list
                $this->checkC( $data, $mk( 1 ), 5, '1L-1' );
@@ -79,23 +80,23 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
 
        /**
         * Test smart continue - list=allpages|alltransclusions
-        * @medium
+        * @group medium
         */
        public function test2Lists() {
                $this->mVerbose = false;
                $mk = function ( $l1, $l2 ) {
-                       return array(
+                       return [
                                'list' => 'allpages|alltransclusions',
                                'apprefix' => 'AQCT-',
                                'atprefix' => 'AQCT-',
                                'atunique' => '',
                                'aplimit' => "$l1",
                                'atlimit' => "$l2",
-                       );
+                       ];
                };
                // 2 lists
                $data = $this->query( $mk( 99, 99 ), 1, '2L', false ) +
-                       array( 'batchcomplete' => true );
+                       [ 'batchcomplete' => true ];
                $this->checkC( $data, $mk( 1, 1 ), 5, '2L-11' );
                $this->checkC( $data, $mk( 2, 2 ), 3, '2L-22' );
                $this->checkC( $data, $mk( 3, 3 ), 2, '2L-33' );
@@ -105,22 +106,22 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
 
        /**
         * Test smart continue - generator=allpages, prop=links
-        * @medium
+        * @group medium
         */
        public function testGen1Prop() {
                $this->mVerbose = false;
                $mk = function ( $g, $p ) {
-                       return array(
+                       return [
                                'generator' => 'allpages',
                                'gapprefix' => 'AQCT-',
                                'gaplimit' => "$g",
                                'prop' => 'links',
                                'pllimit' => "$p",
-                       );
+                       ];
                };
                // generator + 1 prop
                $data = $this->query( $mk( 99, 99 ), 1, 'G1P', false ) +
-                       array( 'batchcomplete' => true );
+                       [ 'batchcomplete' => true ];
                $this->checkC( $data, $mk( 1, 1 ), 11, 'G1P-11' );
                $this->checkC( $data, $mk( 2, 2 ), 6, 'G1P-22' );
                $this->checkC( $data, $mk( 3, 3 ), 4, 'G1P-33' );
@@ -130,23 +131,23 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
 
        /**
         * Test smart continue - generator=allpages, prop=links|templates
-        * @medium
+        * @group medium
         */
        public function testGen2Prop() {
                $this->mVerbose = false;
                $mk = function ( $g, $p1, $p2 ) {
-                       return array(
+                       return [
                                'generator' => 'allpages',
                                'gapprefix' => 'AQCT-',
                                'gaplimit' => "$g",
                                'prop' => 'links|templates',
                                'pllimit' => "$p1",
                                'tllimit' => "$p2",
-                       );
+                       ];
                };
                // generator + 2 props
                $data = $this->query( $mk( 99, 99, 99 ), 1, 'G2P', false ) +
-                       array( 'batchcomplete' => true );
+                       [ 'batchcomplete' => true ];
                $this->checkC( $data, $mk( 1, 1, 1 ), 16, 'G2P-111' );
                $this->checkC( $data, $mk( 2, 2, 2 ), 9, 'G2P-222' );
                $this->checkC( $data, $mk( 3, 3, 3 ), 6, 'G2P-333' );
@@ -161,12 +162,12 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
 
        /**
         * Test smart continue - generator=allpages, prop=links, list=alltransclusions
-        * @medium
+        * @group medium
         */
        public function testGen1Prop1List() {
                $this->mVerbose = false;
                $mk = function ( $g, $p, $l ) {
-                       return array(
+                       return [
                                'generator' => 'allpages',
                                'gapprefix' => 'AQCT-',
                                'gaplimit' => "$g",
@@ -176,11 +177,11 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
                                'atprefix' => 'AQCT-',
                                'atunique' => '',
                                'atlimit' => "$l",
-                       );
+                       ];
                };
                // generator + 1 prop + 1 list
                $data = $this->query( $mk( 99, 99, 99 ), 1, 'G1P1L', false ) +
-                       array( 'batchcomplete' => true );
+                       [ 'batchcomplete' => true ];
                $this->checkC( $data, $mk( 1, 1, 1 ), 11, 'G1P1L-111' );
                $this->checkC( $data, $mk( 2, 2, 2 ), 6, 'G1P1L-222' );
                $this->checkC( $data, $mk( 3, 3, 3 ), 4, 'G1P1L-333' );
@@ -193,12 +194,12 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
        /**
         * Test smart continue - generator=allpages, prop=links|templates,
         *                       list=alllinks|alltransclusions, meta=siteinfo
-        * @medium
+        * @group medium
         */
        public function testGen2Prop2List1Meta() {
                $this->mVerbose = false;
                $mk = function ( $g, $p1, $p2, $l1, $l2 ) {
-                       return array(
+                       return [
                                'generator' => 'allpages',
                                'gapprefix' => 'AQCT-',
                                'gaplimit' => "$g",
@@ -214,11 +215,11 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
                                'atlimit' => "$l2",
                                'meta' => 'siteinfo',
                                'siprop' => 'namespaces',
-                       );
+                       ];
                };
                // generator + 1 prop + 1 list
                $data = $this->query( $mk( 99, 99, 99, 99, 99 ), 1, 'G2P2L1M', false ) +
-                       array( 'batchcomplete' => true );
+                       [ 'batchcomplete' => true ];
                $this->checkC( $data, $mk( 1, 1, 1, 1, 1 ), 16, 'G2P2L1M-11111' );
                $this->checkC( $data, $mk( 2, 2, 2, 2, 2 ), 9, 'G2P2L1M-22222' );
                $this->checkC( $data, $mk( 3, 3, 3, 3, 3 ), 6, 'G2P2L1M-33333' );
@@ -232,12 +233,12 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
 
        /**
         * Test smart continue - generator=templates, prop=templates
-        * @medium
+        * @group medium
         */
        public function testSameGenAndProp() {
                $this->mVerbose = false;
                $mk = function ( $g, $gDir, $p, $pDir ) {
-                       return array(
+                       return [
                                'titles' => 'AQCT-1',
                                'generator' => 'templates',
                                'gtllimit' => "$g",
@@ -245,11 +246,11 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
                                'prop' => 'templates',
                                'tllimit' => "$p",
                                'tldir' => $pDir ? 'ascending' : 'descending',
-                       );
+                       ];
                };
                // generator + 1 prop
                $data = $this->query( $mk( 99, true, 99, true ), 1, 'G=P', false ) +
-                       array( 'batchcomplete' => true );
+                       [ 'batchcomplete' => true ];
 
                $this->checkC( $data, $mk( 1, true, 1, true ), 4, 'G=P-1t1t' );
                $this->checkC( $data, $mk( 2, true, 2, true ), 2, 'G=P-2t2t' );
@@ -278,12 +279,12 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
 
        /**
         * Test smart continue - generator=allpages, list=allpages
-        * @medium
+        * @group medium
         */
        public function testSameGenList() {
                $this->mVerbose = false;
                $mk = function ( $g, $gDir, $l, $pDir ) {
-                       return array(
+                       return [
                                'generator' => 'allpages',
                                'gapprefix' => 'AQCT-',
                                'gaplimit' => "$g",
@@ -292,11 +293,11 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase {
                                'apprefix' => 'AQCT-',
                                'aplimit' => "$l",
                                'apdir' => $pDir ? 'ascending' : 'descending',
-                       );
+                       ];
                };
                // generator + 1 list
                $data = $this->query( $mk( 99, true, 99, true ), 1, 'G=L', false ) +
-                       array( 'batchcomplete' => true );
+                       [ 'batchcomplete' => true ];
 
                $this->checkC( $data, $mk( 1, true, 1, true ), 5, 'G=L-1t1t' );
                $this->checkC( $data, $mk( 2, true, 2, true ), 3, 'G=L-2t2t' );