From 820bb474902acb162e55d83c092105918659ba31 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 1 Jul 2014 18:32:05 +0200 Subject: [PATCH] ApiOptionsTest: Simplify hook restoration Change-Id: I2afc35b45caf9ddfd34fb0bba0839987b7fb2ed4 --- tests/phpunit/includes/api/ApiOptionsTest.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/includes/api/ApiOptionsTest.php b/tests/phpunit/includes/api/ApiOptionsTest.php index e031ce3337..5f955bbc4e 100644 --- a/tests/phpunit/includes/api/ApiOptionsTest.php +++ b/tests/phpunit/includes/api/ApiOptionsTest.php @@ -17,7 +17,7 @@ class ApiOptionsTest extends MediaWikiLangTestCase { /** @var DerivativeContext */ private $mContext; - private $mOldGetPreferencesHooks = false; + private $mOldGetPreferencesHooks; private static $Success = array( 'options' => 'success' ); @@ -61,10 +61,8 @@ class ApiOptionsTest extends MediaWikiLangTestCase { protected function tearDown() { global $wgHooks; - if ( $this->mOldGetPreferencesHooks !== false ) { - $wgHooks['GetPreferences'] = $this->mOldGetPreferencesHooks; - $this->mOldGetPreferencesHooks = false; - } + $wgHooks['GetPreferences'] = $this->mOldGetPreferencesHooks; + $this->mOldGetPreferencesHooks = false; parent::tearDown(); } -- 2.20.1