diff --git a/tests/phpunit/SimpleCaptcha/CaptchaTest.php b/tests/phpunit/SimpleCaptcha/CaptchaTest.php index e392dfaeb..59cb13733 100644 --- a/tests/phpunit/SimpleCaptcha/CaptchaTest.php +++ b/tests/phpunit/SimpleCaptcha/CaptchaTest.php @@ -1,6 +1,6 @@ createMock( User::class ); $user->method( 'isEmailConfirmed' )->willReturn( $userIsMailConfirmed ); - $config = $this->createMock( Config::class ); - $config->method( 'get' )->willReturn( $allowUserConfirmEmail ); + $config = new HashConfig( [ 'AllowConfirmedEmail' => $allowUserConfirmEmail ] ); $actual = $testObject->canSkipCaptcha( $user, $config ); @@ -164,7 +163,7 @@ class CaptchaTest extends MediaWikiIntegrationTestCase { */ public function testCanSkipCaptchaIPWhitelisted( $requestIP, $IPWhitelist, $expected ) { $testObject = new SimpleCaptcha(); - $config = $this->createMock( Config::class ); + $config = new HashConfig( [ 'AllowConfirmedEmail' => false ] ); $request = $this->createMock( WebRequest::class ); $request->method( 'getIP' )->willReturn( $requestIP );