]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - extensions/ConfirmEdit/tests/phpunit/ReCaptchaAuthenticationRequestTest.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / extensions / ConfirmEdit / tests / phpunit / ReCaptchaAuthenticationRequestTest.php
diff --git a/extensions/ConfirmEdit/tests/phpunit/ReCaptchaAuthenticationRequestTest.php b/extensions/ConfirmEdit/tests/phpunit/ReCaptchaAuthenticationRequestTest.php
new file mode 100644 (file)
index 0000000..71fa058
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+use MediaWiki\Auth\AuthenticationRequestTestCase;
+
+require_once __DIR__ . '/../../ReCaptcha/ReCaptchaAuthenticationRequest.php';
+
+class ReCaptchaAuthenticationRequestTest extends AuthenticationRequestTestCase {
+       protected function getInstance( array $args = [] ) {
+               return new ReCaptchaAuthenticationRequest();
+       }
+
+       public function provideLoadFromSubmission() {
+               return [
+                       'no challange id' => [ [], [ 'captchaWord' => 'abc' ], false ],
+                       'no solution' => [ [], [ 'captchaId' => '123' ], false ],
+                       'normal' => [ [], [ 'captchaId' => '123', 'captchaWord' => 'abc' ],
+                               [ 'captchaId' => '123', 'captchaWord' => 'abc' ] ],
+               ];
+       }
+}