Phuedx has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312244

Change subject: Hygiene: Remove BogusMobileContext
......................................................................

Hygiene: Remove BogusMobileContext

The BogusMobileContext and MobileContext::setInstanceForTesting method
were used to create an implicit test that MobileContext::singleton
wasn't called throughout the MobileContextTest test suite.

It's not clear why this assertion needs to be made at all.

Changes:
* Remove BogusMobileContext
* Remove MobileContext::setInstanceForTesting as it no longer used

Bug: T143875
Change-Id: I682f70d904a96ccfbf392e15eaa577891472cd52
---
M includes/MobileContext.php
M tests/phpunit/MobileContextTest.php
2 files changed, 0 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/44/312244/1

diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index bd54b1f..2cb8e63 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -121,18 +121,6 @@
        }
 
        /**
-        * Overrides the singleton instance.
-        *
-        * @warning This method should only accept instances of 
`MobileContext`. The `BogusMobileContext`
-        *  class is used in the `MobileContextTest` test suite and will be 
removed.
-        *
-        * @param MobileContext|BogusContext $instance
-        */
-       public static function setInstanceForTesting( $instance ) {
-               self::$instance = $instance;
-       }
-
-       /**
         * Resets the singleton instance.
         */
        public static function resetInstanceForTesting() {
diff --git a/tests/phpunit/MobileContextTest.php 
b/tests/phpunit/MobileContextTest.php
index dfb7287..15a87e2 100644
--- a/tests/phpunit/MobileContextTest.php
+++ b/tests/phpunit/MobileContextTest.php
@@ -21,8 +21,6 @@
 
        protected function setUp() {
                parent::setUp();
-               // Permit no access to the singleton
-               MobileContext::setInstanceForTesting( new BogusMobileContext() 
);
        }
 
        protected function tearDown() {
@@ -658,11 +656,5 @@
                $this->setMwGlobals( 'wgTitle', null );
                SpecialPage::getTitleFor( 'Search' );
                $this->assertTrue( true, 'In case of failure this test just 
crashes' );
-       }
-}
-
-class BogusMobileContext {
-       public function __call( $who, $cares ) {
-               throw new Exception( "Don't touch me!" );
        }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I682f70d904a96ccfbf392e15eaa577891472cd52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx <g...@samsmith.io>

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

Reply via email to