mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-12-03 20:26:39 +00:00
5b7a36a521
Change-Id: Ie956fe86184535a376d0398483ac3c853fa9127c
25 lines
619 B
PHP
25 lines
619 B
PHP
<?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();
|
|
}
|
|
}
|