17 if ( is_array( $expect ) ) {
19 $res->messageType =
'warning';
20 foreach ( $expect as $field =>
$value ) {
23 $ret = call_user_func_array(
"MediaWiki\\Auth\\AuthenticationResponse::$constructor",
$args );
27 call_user_func_array(
"MediaWiki\\Auth\\AuthenticationResponse::$constructor",
$args );
28 $this->fail(
'Expected exception not thrown' );
29 }
catch ( \Exception $ex ) {
30 $this->assertEquals( $expect, $ex );
36 $req = $this->getMockForAbstractClass( AuthenticationRequest::class );
37 $msg = new \Message(
'mainpage' );
43 [
'newPass', [
'name' ], [
47 [
'newPass', [
'name', null ], [
52 [
'newFail', [ $msg ], [
55 'messageType' =>
'error',
58 [
'newRestart', [ $msg ], [
67 [
'newUI', [ [
$req ], $msg ], [
69 'neededRequests' => [
$req ],
71 'messageType' =>
'warning',
74 [
'newUI', [ [
$req ], $msg,
'warning' ], [
76 'neededRequests' => [
$req ],
78 'messageType' =>
'warning',
81 [
'newUI', [ [
$req ], $msg,
'error' ], [
83 'neededRequests' => [
$req ],
85 'messageType' =>
'error',
87 [
'newUI', [ [], $msg ],
88 new \InvalidArgumentException(
'$reqs may not be empty' )
91 [
'newRedirect', [ [
$req ],
'http://example.org/redir' ], [
93 'neededRequests' => [
$req ],
94 'redirectTarget' =>
'http://example.org/redir',
98 [ [
$req ],
'http://example.org/redir', [
'foo' =>
'bar' ] ],
101 'neededRequests' => [
$req ],
102 'redirectTarget' =>
'http://example.org/redir',
103 'redirectApiData' => [
'foo' =>
'bar' ],
106 [
'newRedirect', [ [],
'http://example.org/redir' ],
107 new \InvalidArgumentException(
'$reqs may not be empty' )
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