mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-27 09:30:06 +00:00
build: Updating composer dependencies
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0 * php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0 Change-Id: Ib16a714334088d26d3fbaa88b5c9395fa0ab67a5
This commit is contained in:
parent
59c0edef93
commit
bef3c335b5
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"require-dev": {
|
||||
"mediawiki/mediawiki-codesniffer": "35.0.0",
|
||||
"mediawiki/mediawiki-codesniffer": "36.0.0",
|
||||
"mediawiki/mediawiki-phan-config": "0.10.6",
|
||||
"mediawiki/minus-x": "1.1.1",
|
||||
"php-parallel-lint/php-console-highlighter": "0.5.0",
|
||||
"php-parallel-lint/php-parallel-lint": "1.2.0"
|
||||
"php-parallel-lint/php-parallel-lint": "1.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": [
|
||||
|
|
|
@ -102,13 +102,13 @@ class CaptchaPreAuthenticationProviderTest extends MediaWikiTestCase {
|
|||
public function testTestForAuthentication( $req, $isBadLoginTriggered,
|
||||
$isBadLoginPerUserTriggered, $result
|
||||
) {
|
||||
$this->setTemporaryHook( 'PingLimiter', function ( $user, $action, &$result ) {
|
||||
$this->setTemporaryHook( 'PingLimiter', static function ( $user, $action, &$result ) {
|
||||
$result = false;
|
||||
return false;
|
||||
} );
|
||||
CaptchaStore::get()->store( '345', [ 'question' => '2+2', 'answer' => '4' ] );
|
||||
$captcha = $this->getMockBuilder( SimpleCaptcha::class )
|
||||
->setMethods( [ 'isBadLoginTriggered', 'isBadLoginPerUserTriggered' ] )
|
||||
->onlyMethods( [ 'isBadLoginTriggered', 'isBadLoginPerUserTriggered' ] )
|
||||
->getMock();
|
||||
$captcha->expects( $this->any() )->method( 'isBadLoginTriggered' )
|
||||
->willReturn( $isBadLoginTriggered );
|
||||
|
@ -142,7 +142,7 @@ class CaptchaPreAuthenticationProviderTest extends MediaWikiTestCase {
|
|||
* @dataProvider provideTestForAccountCreation
|
||||
*/
|
||||
public function testTestForAccountCreation( $req, $creator, $result, $disableTrigger = false ) {
|
||||
$this->setTemporaryHook( 'PingLimiter', function ( $user, $action, &$result ) {
|
||||
$this->setTemporaryHook( 'PingLimiter', static function ( $user, $action, &$result ) {
|
||||
$result = false;
|
||||
return false;
|
||||
} );
|
||||
|
@ -228,7 +228,7 @@ class CaptchaPreAuthenticationProviderTest extends MediaWikiTestCase {
|
|||
|
||||
$disablePingLimiter = false;
|
||||
$this->setTemporaryHook( 'PingLimiter',
|
||||
function ( &$user, $action, &$result ) use ( &$disablePingLimiter ) {
|
||||
static function ( &$user, $action, &$result ) use ( &$disablePingLimiter ) {
|
||||
if ( $disablePingLimiter ) {
|
||||
$result = false;
|
||||
return false;
|
||||
|
@ -288,7 +288,7 @@ class CaptchaPreAuthenticationProviderTest extends MediaWikiTestCase {
|
|||
protected function setTriggers( $triggers ) {
|
||||
$types = [ 'edit', 'create', 'sendemail', 'addurl', 'createaccount', 'badlogin',
|
||||
'badloginperuser' ];
|
||||
$captchaTriggers = array_combine( $types, array_map( function ( $type ) use ( $triggers ) {
|
||||
$captchaTriggers = array_combine( $types, array_map( static function ( $type ) use ( $triggers ) {
|
||||
return in_array( $type, $triggers, true );
|
||||
}, $types ) );
|
||||
$this->setMwGlobals( 'wgCaptchaTriggers', $captchaTriggers );
|
||||
|
|
|
@ -19,7 +19,7 @@ class HTMLFancyCaptchaFieldTest extends PHPUnit\Framework\TestCase {
|
|||
|
||||
public function testValue() {
|
||||
$mockClosure = $this->getMockBuilder( stdClass::class )
|
||||
->setMethods( [ '__invoke' ] )->getMock();
|
||||
->addMethods( [ '__invoke' ] )->getMock();
|
||||
$request = new FauxRequest( [ 'wpcaptchaWord' => 'abc' ], true );
|
||||
$form = $this->getForm( [ 'imageUrl' => 'https://example.com/' ], $request );
|
||||
$form->setSubmitCallback( $mockClosure );
|
||||
|
|
|
@ -16,7 +16,7 @@ class HTMLReCaptchaNoCaptchaFieldTest extends PHPUnit\Framework\TestCase {
|
|||
'g-recaptcha-response' => 'def',
|
||||
], true );
|
||||
$mockClosure = $this->getMockBuilder( stdClass::class )
|
||||
->setMethods( [ '__invoke' ] )->getMock();
|
||||
->addMethods( [ '__invoke' ] )->getMock();
|
||||
$mockClosure->expects( $this->once() )->method( '__invoke' )
|
||||
->with( [ 'foo' => 'def' ] )->willReturn( true );
|
||||
|
||||
|
|
Loading…
Reference in a new issue