X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fuser%2FPasswordResetTest.php;h=68b79591f643a9bd12ecbe09c8378418298394e0;hb=5fa4cdf860c79b32ab6ef034c6d9420c2727f695;hp=53f02df69c1c33d4e57087d40800aab603aa0bf7;hpb=7f3d6713e7191c476adb3d3c30344a0327b853d3;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/user/PasswordResetTest.php b/tests/phpunit/includes/user/PasswordResetTest.php index 53f02df69c..68b79591f6 100644 --- a/tests/phpunit/includes/user/PasswordResetTest.php +++ b/tests/phpunit/includes/user/PasswordResetTest.php @@ -5,7 +5,7 @@ use MediaWiki\Auth\AuthManager; /** * @group Database */ -class PasswordResetTest extends PHPUnit_Framework_TestCase { +class PasswordResetTest extends MediaWikiTestCase { /** * @dataProvider provideIsAllowed */ @@ -150,6 +150,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' )