jenkins-bot has submitted this change and it was merged.

Change subject: Remove ActionTestCase::shouldTestRedirects
......................................................................


Remove ActionTestCase::shouldTestRedirects

No longer needed, see also 08ccacacc55540408a7fcecf7fdb282459d0405b

Change-Id: I193d469254a0e8e22542b81a61a76985f45959c5
---
M repo/tests/phpunit/includes/Actions/ActionTestCase.php
M repo/tests/phpunit/includes/Actions/EditEntityActionTest.php
M repo/tests/phpunit/includes/Actions/ViewEntityActionTest.php
3 files changed, 20 insertions(+), 42 deletions(-)

Approvals:
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/tests/phpunit/includes/Actions/ActionTestCase.php 
b/repo/tests/phpunit/includes/Actions/ActionTestCase.php
index 6d4e945..39d27ee 100644
--- a/repo/tests/phpunit/includes/Actions/ActionTestCase.php
+++ b/repo/tests/phpunit/includes/Actions/ActionTestCase.php
@@ -5,10 +5,8 @@
 use Action;
 use ApiQueryInfo;
 use Article;
-use ContentHandler;
 use Exception;
 use FauxRequest;
-use Language;
 use MWException;
 use OutputPage;
 use RequestContext;
@@ -78,11 +76,6 @@
                $wgUser->removeGroup( "dummy" );
        }
 
-       protected function shouldTestRedirects() {
-               $handler = ContentHandler::getForModelID( 
CONTENT_MODEL_WIKIBASE_ITEM );
-               return $handler->supportsRedirects();
-       }
-
        /**
         * @var EntityDocument[]|EntityRedirect[] List of EntityDocument or 
EntityRedirect objects,
         *      with logical handles as keys.
@@ -125,14 +118,12 @@
                $item->setLabel( 'en', 'Oslo' );
                $items['Oslo'][] = $item;
 
-               if ( $this->shouldTestRedirects() ) {
-                       $item = new Item();
-                       $item->setLabel( 'de', 'Berlin' );
-                       $items['Berlin2'][] = $item;
+               $item = new Item();
+               $item->setLabel( 'de', 'Berlin' );
+               $items['Berlin2'][] = $item;
 
-                       // HACK: this revision is a redirect
-                       $items['Berlin2'][] = 'Berlin';
-               }
+               // HACK: this revision is a redirect
+               $items['Berlin2'][] = 'Berlin';
 
                return $items;
        }
diff --git a/repo/tests/phpunit/includes/Actions/EditEntityActionTest.php 
b/repo/tests/phpunit/includes/Actions/EditEntityActionTest.php
index 9e89529..c24b5d0 100644
--- a/repo/tests/phpunit/includes/Actions/EditEntityActionTest.php
+++ b/repo/tests/phpunit/includes/Actions/EditEntityActionTest.php
@@ -291,19 +291,17 @@
 
                );
 
-               if ( self::shouldTestRedirects() ) {
-                       // -- show undo form for redirect 
-----------------------------------
-                       $cases[] = array( //18: // undo form with legal undo
-                               'edit', // action
-                               'Berlin2', // handle
-                               array( // params
-                                       'undo' => 0, // current revision
-                               ),
-                               false, // post
-                               null, // user
-                               '/undo-success/', // htmlPattern: should be a 
success
-                       );
-               }
+               // -- show undo form for redirect 
-----------------------------------
+               $cases[] = array( //18: // undo form with legal undo
+                       'edit', // action
+                       'Berlin2', // handle
+                       array( // params
+                               'undo' => 0, // current revision
+                       ),
+                       false, // post
+                       null, // user
+                       '/undo-success/', // htmlPattern: should be a success
+               );
 
                return $cases;
        }
diff --git a/repo/tests/phpunit/includes/Actions/ViewEntityActionTest.php 
b/repo/tests/phpunit/includes/Actions/ViewEntityActionTest.php
index ad1f261..02495ce 100644
--- a/repo/tests/phpunit/includes/Actions/ViewEntityActionTest.php
+++ b/repo/tests/phpunit/includes/Actions/ViewEntityActionTest.php
@@ -41,21 +41,10 @@
        }
 
        public function provideShow() {
-               $cases = array();
-
-               $cases[] = array(
-                       'Berlin',
-                       '/Hauptstadt von Deutschland/'
-               );
-
-               if ( self::shouldTestRedirects() ) {
-                       $cases[] = array(
-                               'Berlin2',
-                               '/redirectMsg/'
-                       );
-               }
-
-               return $cases;
+               return [
+                       [ 'Berlin', '/Hauptstadt von Deutschland/' ],
+                       [ 'Berlin2', '/redirectMsg/' ]
+               ];
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/277351
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I193d469254a0e8e22542b81a61a76985f45959c5
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to