35 $req->action = $action;
36 $info[$action] =
$req->getFieldInfo();
42 'No need to retype password on login' );
44 'Domain needed on login' );
46 'Need to retype when creating new password' );
48 'Domain needed on account creation' );
50 'Need to retype when changing password' );
52 'Domain not needed on account creation' );
54 $this->assertNotEquals(
57 'Password field for change is differentiated from login'
59 $this->assertNotEquals(
62 'Password field for change is differentiated from create'
64 $this->assertNotEquals(
67 'Retype field for change is differentiated from create'
72 $domainList = [
'domainList' => [
'd1',
'd2' ] ];
74 'Empty request, login' => [
79 'Empty request, change' => [
84 'Empty request, remove' => [
89 'Username + password, login' => [
91 $data = [
'username' =>
'User',
'password' =>
'Bar' ],
94 'Username + password + domain, login' => [
96 $data = [
'username' =>
'User',
'password' =>
'Bar',
'domain' =>
'd1' ],
99 'Username + password + bad domain, login' => [
101 $data = [
'username' =>
'User',
'password' =>
'Bar',
'domain' =>
'd5' ],
104 'Username + password + domain, change' => [
106 [
'username' =>
'User',
'password' =>
'Bar',
'domain' =>
'd1' ],
109 'Username + password + domain + retype' => [
111 [
'username' =>
'User',
'password' =>
'Bar',
'retype' =>
'baz',
'domain' =>
'd1' ],
115 'Username empty, login' => [
117 [
'username' =>
'',
'password' =>
'Bar',
'domain' =>
'd1' ],
120 'Username empty, change' => [
122 [
'username' =>
'',
'password' =>
'Bar',
'retype' =>
'baz',
'domain' =>
'd1' ],
126 'Password empty, login' => [
128 [
'username' =>
'User',
'password' =>
'',
'domain' =>
'd1' ],
131 'Password empty, login, with retype' => [
133 [
'username' =>
'User',
'password' =>
'',
'retype' =>
'baz',
'domain' =>
'd1' ],
138 [
'username' =>
'User',
'password' =>
'Bar',
'retype' =>
'',
'domain' =>
'd1' ],
147 $req->username =
'UTSysop';
150 $this->assertInternalType(
'array',
$ret );
151 $this->assertArrayHasKey(
'provider',
$ret );
152 $this->assertInstanceOf( \Message::class,
$ret[
'provider'] );
153 $this->assertSame(
'authmanager-provider-password-domain',
$ret[
'provider']->getKey() );
154 $this->assertArrayHasKey(
'account',
$ret );
155 $this->assertInstanceOf( \Message::class,
$ret[
'account'] );
156 $this->assertSame(
'authmanager-account-password-domain',
$ret[
'account']->getKey() );
157 $this->assertSame( [
'UTSysop',
'd2' ],
$ret[
'account']->getParams() );
AuthManager MediaWiki\Auth\PasswordDomainAuthenticationRequest.
testDescribeCredentials()
static provideGetFieldInfo()
getInstance(array $args=[])
provideLoadFromSubmission()
This is a value object for authentication requests with a username, password, and domain.
this hook is for auditing only $req
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret