]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - tests/phpunit/includes/auth/UsernameAuthenticationRequestTest.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / tests / phpunit / includes / auth / UsernameAuthenticationRequestTest.php
diff --git a/tests/phpunit/includes/auth/UsernameAuthenticationRequestTest.php b/tests/phpunit/includes/auth/UsernameAuthenticationRequestTest.php
new file mode 100644 (file)
index 0000000..63628dd
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+namespace MediaWiki\Auth;
+
+/**
+ * @group AuthManager
+ * @covers MediaWiki\Auth\UsernameAuthenticationRequest
+ */
+class UsernameAuthenticationRequestTest extends AuthenticationRequestTestCase {
+
+       protected function getInstance( array $args = [] ) {
+               return new UsernameAuthenticationRequest();
+       }
+
+       public function provideLoadFromSubmission() {
+               return [
+                       'Empty request' => [
+                               [],
+                               [],
+                               false
+                       ],
+                       'Username' => [
+                               [],
+                               $data = [ 'username' => 'User' ],
+                               $data,
+                       ],
+                       'Username empty' => [
+                               [],
+                               [ 'username' => '' ],
+                               false
+                       ],
+               ];
+       }
+}