X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fauth%2FAuthenticationResponseTest.php;h=c79682275f9d7e3aed8eedbae5978be38f2107ce;hb=9ef8c9608d7aec920121671fcbe11e3f459f1946;hp=477b1617f5a2f2473e8636e3ff407a02290dfa50;hpb=f82b0e76306a9feca014e563a5fac0688cf876dc;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/auth/AuthenticationResponseTest.php b/tests/phpunit/includes/auth/AuthenticationResponseTest.php index 477b1617f5..c79682275f 100644 --- a/tests/phpunit/includes/auth/AuthenticationResponseTest.php +++ b/tests/phpunit/includes/auth/AuthenticationResponseTest.php @@ -4,7 +4,7 @@ namespace MediaWiki\Auth; /** * @group AuthManager - * @covers MediaWiki\Auth\AuthenticationResponse + * @covers \MediaWiki\Auth\AuthenticationResponse */ class AuthenticationResponseTest extends \MediaWikiTestCase { /** @@ -16,6 +16,7 @@ class AuthenticationResponseTest extends \MediaWikiTestCase { public function testConstructors( $constructor, $args, $expect ) { if ( is_array( $expect ) ) { $res = new AuthenticationResponse(); + $res->messageType = 'warning'; foreach ( $expect as $field => $value ) { $res->$field = $value; } @@ -51,6 +52,7 @@ class AuthenticationResponseTest extends \MediaWikiTestCase { [ 'newFail', [ $msg ], [ 'status' => AuthenticationResponse::FAIL, 'message' => $msg, + 'messageType' => 'error', ] ], [ 'newRestart', [ $msg ], [ @@ -66,6 +68,21 @@ class AuthenticationResponseTest extends \MediaWikiTestCase { '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' )