mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-15 03:35:15 +00:00
08bfd32590
Change-Id: Ide145e5755e0bec11fe19c18889c92a0e9d78037
27 lines
686 B
PHP
27 lines
686 B
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../../ReCaptcha/HTMLReCaptchaField.php';
|
|
|
|
/**
|
|
* @covers HTMLReCaptchaField
|
|
*/
|
|
class HTMLReCaptchaFieldTest extends PHPUnit\Framework\TestCase {
|
|
public function testSubmit() {
|
|
$form = new HTMLForm( [
|
|
'foo' => [
|
|
'class' => HTMLReCaptchaField::class,
|
|
'key' => '123',
|
|
'theme' => 'x',
|
|
],
|
|
] );
|
|
$mockClosure = $this->getMockBuilder( 'object' )->setMethods( [ '__invoke' ] )->getMock();
|
|
$mockClosure->expects( $this->once() )->method( '__invoke' )
|
|
->with( [] )->willReturn( true );
|
|
|
|
$form->setTitle( Title::newFromText( 'Title' ) );
|
|
$form->setSubmitCallback( $mockClosure );
|
|
$form->prepareForm();
|
|
$form->trySubmit();
|
|
}
|
|
}
|