From bb910388c7893b65bb61db99f29cdd45033ddd80 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 16 Oct 2014 19:38:31 +0200 Subject: [PATCH] Use setMwGlobals in UserTest::testPasswordExpire Change-Id: Ida1a43629853abf648867f29e3bf15bdfd4291a6 --- tests/phpunit/includes/UserTest.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/phpunit/includes/UserTest.php b/tests/phpunit/includes/UserTest.php index a0c20bb407..f9ef3177e5 100644 --- a/tests/phpunit/includes/UserTest.php +++ b/tests/phpunit/includes/UserTest.php @@ -281,9 +281,7 @@ class UserTest extends MediaWikiTestCase { * @covers User::getPasswordExpired() */ public function testPasswordExpire() { - global $wgPasswordExpireGrace; - $wgTemp = $wgPasswordExpireGrace; - $wgPasswordExpireGrace = 3600 * 24 * 7; // 7 days + $this->setMwGlobals( 'wgPasswordExpireGrace', 3600 * 24 * 7 ); // 7 days $user = User::newFromName( 'UnitTestUser' ); $user->loadDefaults( 'UnitTestUser' ); @@ -296,8 +294,6 @@ class UserTest extends MediaWikiTestCase { $ts = time() - ( 3600 * 24 * 10 ); // 10 days ago $user->expirePassword( $ts ); $this->assertEquals( 'hard', $user->getPasswordExpired() ); - - $wgPasswordExpireGrace = $wgTemp; } /** -- 2.20.1