Merge "Added updated version history from 1.19.2 to 1.22.13"
[lhc/web/wiklou.git] / 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;
        }
 
        /**