Merge "Use setMwGlobals in UserTest::testPasswordExpire"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 23 Oct 2014 17:55:20 +0000 (17:55 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 23 Oct 2014 17:55:20 +0000 (17:55 +0000)
tests/phpunit/includes/UserTest.php

index a0c20bb..f9ef317 100644 (file)
@@ -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;
        }
 
        /**