X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fuser%2FPasswordResetTest.php;h=1f578ab0c877a01fbe0a0cf5f779b26702027aef;hb=ee96c8894ae8b272c41cd759423e01d16def4ae8;hp=53f02df69c1c33d4e57087d40800aab603aa0bf7;hpb=7471e1db1b613d035f981f489f8683a177acff7e;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/user/PasswordResetTest.php b/tests/phpunit/includes/user/PasswordResetTest.php index 53f02df69c..1f578ab0c8 100644 --- a/tests/phpunit/includes/user/PasswordResetTest.php +++ b/tests/phpunit/includes/user/PasswordResetTest.php @@ -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' )