[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Remove BogusMobileContext

2016-09-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

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(-)

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



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: merged
Gerrit-Change-Id: I682f70d904a96ccfbf392e15eaa577891472cd52
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Remove BogusMobileContext

2016-09-22 Thread Phuedx (Code Review)
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 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Remove BogusMobileContext

2016-09-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

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.

Since MobileContext::singleton, ::setInstanceForTesting, and
::resetServiceForTesting were deprecated in 535f18b1 and will be removed
as part of T143189, it's no longer worth maintaining BogusMobileContext

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

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



diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index a848cb7..dadf7a0 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -132,20 +132,6 @@
}
 
/**
-* Overrides the singleton instance.
-*
-* @deprecated See `MobileContext::singleton`.
-*
-* @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} $instance
-*/
-   public static function setInstanceForTesting( $instance ) {
-   self::$instance = $instance;
-   }
-
-   /**
 * Resets the `MobileFrontend.MobileContext` service and singleton 
instance.
 *
 * @deprecated See `MobileContext::singleton`.
diff --git a/tests/phpunit/MobileContextTest.php 
b/tests/phpunit/MobileContextTest.php
index b98b6cd..c7a42ee 100644
--- a/tests/phpunit/MobileContextTest.php
+++ b/tests/phpunit/MobileContextTest.php
@@ -34,8 +34,6 @@
 
protected function setUp() {
parent::setUp();
-   // Permit no access to the singleton
-   MobileContext::setInstanceForTesting( new BogusMobileContext() 
);
 
$this->config = new GlobalVarConfig();
$this->baseContext = RequestContext::getMain();
@@ -691,11 +689,5 @@
$context = $this->makeContext();
 
$this->assertSame( $this->config, $context->getMFConfig() );
-   }
-}
-
-class BogusMobileContext {
-   public function __call( $who, $cares ) {
-   throw new Exception( "Don't touch me!" );
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f42c7062a8b6ebff8f3b3c70616fb0719b933a2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Phuedx 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Remove BogusMobileContext

2016-09-08 Thread Phuedx (Code Review)
Phuedx has uploaded a new change for review.

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

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.

Since MobileContext::singleton, ::setInstanceForTesting, and
::resetServiceForTesting were deprecated in 535f18b1 and will be removed
as part of T143189, it's no longer worth maintaining BogusMobileContext

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


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

diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index a848cb7..dadf7a0 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -132,20 +132,6 @@
}
 
/**
-* Overrides the singleton instance.
-*
-* @deprecated See `MobileContext::singleton`.
-*
-* @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} $instance
-*/
-   public static function setInstanceForTesting( $instance ) {
-   self::$instance = $instance;
-   }
-
-   /**
 * Resets the `MobileFrontend.MobileContext` service and singleton 
instance.
 *
 * @deprecated See `MobileContext::singleton`.
diff --git a/tests/phpunit/MobileContextTest.php 
b/tests/phpunit/MobileContextTest.php
index b98b6cd..c7a42ee 100644
--- a/tests/phpunit/MobileContextTest.php
+++ b/tests/phpunit/MobileContextTest.php
@@ -34,8 +34,6 @@
 
protected function setUp() {
parent::setUp();
-   // Permit no access to the singleton
-   MobileContext::setInstanceForTesting( new BogusMobileContext() 
);
 
$this->config = new GlobalVarConfig();
$this->baseContext = RequestContext::getMain();
@@ -691,11 +689,5 @@
$context = $this->makeContext();
 
$this->assertSame( $this->config, $context->getMFConfig() );
-   }
-}
-
-class BogusMobileContext {
-   public function __call( $who, $cares ) {
-   throw new Exception( "Don't touch me!" );
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f42c7062a8b6ebff8f3b3c70616fb0719b933a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx 

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