tests: getMock() is deprecated

Bug: T192167
Change-Id: I385dccbcda40c71201ce1f5553cb30dee53a6a33
This commit is contained in:
Max Semenik 2019-10-21 21:52:40 -07:00
parent c706753465
commit 8b6b9aaa86

View file

@ -107,8 +107,9 @@ class CaptchaPreAuthenticationProviderTest extends MediaWikiTestCase {
return false;
} );
CaptchaStore::get()->store( '345', [ 'question' => '2+2', 'answer' => '4' ] );
$captcha = $this->getMock( SimpleCaptcha::class,
[ 'isBadLoginTriggered', 'isBadLoginPerUserTriggered' ] );
$captcha = $this->getMockBuilder( SimpleCaptcha::class )
->setMethods( [ 'isBadLoginTriggered', 'isBadLoginPerUserTriggered' ] )
->getMock();
$captcha->expects( $this->any() )->method( 'isBadLoginTriggered' )
->willReturn( $isBadLoginTriggered );
$captcha->expects( $this->any() )->method( 'isBadLoginPerUserTriggered' )