public function testConstructors( $constructor, $args, $expect ) {
if ( is_array( $expect ) ) {
$res = new AuthenticationResponse();
+ $res->messageType = 'warning';
foreach ( $expect as $field => $value ) {
$res->$field = $value;
}
[ 'newFail', [ $msg ], [
'status' => AuthenticationResponse::FAIL,
'message' => $msg,
+ 'messageType' => 'error',
] ],
[ 'newRestart', [ $msg ], [
'status' => AuthenticationResponse::UI,
'neededRequests' => [ $req ],
'message' => $msg,
+ 'messageType' => 'warning',
+ ] ],
+
+ [ 'newUI', [ [ $req ], $msg, 'warning' ], [
+ 'status' => AuthenticationResponse::UI,
+ 'neededRequests' => [ $req ],
+ 'message' => $msg,
+ 'messageType' => 'warning',
+ ] ],
+
+ [ 'newUI', [ [ $req ], $msg, 'error' ], [
+ 'status' => AuthenticationResponse::UI,
+ 'neededRequests' => [ $req ],
+ 'message' => $msg,
+ 'messageType' => 'error',
] ],
[ 'newUI', [ [], $msg ],
new \InvalidArgumentException( '$reqs may not be empty' )