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

Change subject: Fix SpecialMobileDiffTest#testNames test
......................................................................


Fix SpecialMobileDiffTest#testNames test

To generate the diff, SpecialMobileDiff#showDiff defers to
DifferenceEngine#generateContentDiffBody. This method loads the prev and
next revisions from the DB by ID directly rather than accepting them as
parameters. This behaviour is non-trivial to isolate in a test.

The SpecialMobileDiffTest#testNames test exercises how
SpecialMobileDiff#executeWhenAvailable handles parameter validation. In
doing so, however, it invokes #showDiff. Therefore, depending on the
current state of the DB, a revision may be loaded from the DB
inadvertently.

Because the #showDiff method doesn't affect the return result of
 #executeWhenAvailable we can safely stub it and re-enable the test.

Bug: T100716
Change-Id: I19df8acd50bc32f594ad10b6e33a2dd66825f176
---
M tests/phpunit/specials/SpecialMobileDiffTest.php
1 file changed, 2 insertions(+), 3 deletions(-)

Approvals:
  Kaldari: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/phpunit/specials/SpecialMobileDiffTest.php 
b/tests/phpunit/specials/SpecialMobileDiffTest.php
index aad1d45..747eb99 100644
--- a/tests/phpunit/specials/SpecialMobileDiffTest.php
+++ b/tests/phpunit/specials/SpecialMobileDiffTest.php
@@ -15,10 +15,7 @@
                parent::tearDown();
        }
        /**
-        * Broken per T100716
-        *
         * @dataProvider providerTestNames
-        * @group Broken
         */
        public function testNames( $par, $expected ) {
                $page = new MockSpecialMobileDiff();
@@ -125,6 +122,8 @@
        public function executeBadQuery() {
                return false;
        }
+       public function showDiff() {
+       }
 }
 
 class MFMockRevision extends Revision {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I19df8acd50bc32f594ad10b6e33a2dd66825f176
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx <g...@samsmith.io>
Gerrit-Reviewer: Kaldari <rkald...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to