MediaWiki REL1_33
HTMLReCaptchaFieldTest.php
Go to the documentation of this file.
1<?php
2
6class HTMLReCaptchaFieldTest extends PHPUnit\Framework\TestCase {
7 public function testSubmit() {
8 $form = new HTMLForm( [
9 'foo' => [
10 'class' => HTMLReCaptchaField::class,
11 'key' => '123',
12 'theme' => 'x',
13 ],
14 ] );
15 $mockClosure = $this->getMockBuilder( stdClass::class )
16 ->setMethods( [ '__invoke' ] )->getMock();
17 $mockClosure->expects( $this->once() )->method( '__invoke' )
18 ->with( [] )->willReturn( true );
19
20 $form->setTitle( Title::newFromText( 'Title' ) );
21 $form->setSubmitCallback( $mockClosure );
22 $form->prepareForm();
23 $form->trySubmit();
24 }
25}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Object handling generic submission, CSRF protection, layout and other logic for UI forms.
Definition HTMLForm.php:133