Merge "Change php extract() to explicit code"
[lhc/web/wiklou.git] / tests / phpunit / includes / user / PasswordResetTest.php
index 53f02df..1f578ab 100644 (file)
@@ -3,9 +3,10 @@
 use MediaWiki\Auth\AuthManager;
 
 /**
+ * @covers PasswordReset
  * @group Database
  */
-class PasswordResetTest extends PHPUnit_Framework_TestCase {
+class PasswordResetTest extends MediaWikiTestCase {
        /**
         * @dataProvider provideIsAllowed
         */
@@ -150,6 +151,12 @@ class PasswordResetTest extends PHPUnit_Framework_TestCase {
                        'EnableEmail' => true,
                ] );
 
+               // Unregister the hooks for proper unit testing
+               $this->mergeMwGlobalArrayValue( 'wgHooks', [
+                       'User::mailPasswordInternal' => [],
+                       'SpecialPasswordResetOnSubmit' => [],
+               ] );
+
                $authManager = $this->getMockBuilder( AuthManager::class )->disableOriginalConstructor()
                        ->getMock();
                $authManager->expects( $this->any() )->method( 'allowsAuthenticationDataChange' )