wiki.techinc.nl/tests/phpunit/includes/auth
Florian Schmidt 38fce189c4 Consistent behavior of read-only reason
Before this commit, the reason set in the global $wgReadOnly was differently handled
on different special pages. While on most of them, like Special:Upload, the reason
is allowed to have HTML, which can be used in Wikitext, too, Special:CreateAccount
always outputted an escaped version of this reason.

Most special pages uses the ReadOnlyError exception to print a read-only error,
however, AuthManager uses Status objects to communicate between the backend and the
frontend. Therefore the same message and parameters were wrapped in a Status object
and, in the frontend, directly passed to the constructor of ErrorPageError. Unfortunately,
Status::getMessage() escapes the parameters of a message, which is the reason, why the
wiki is read-only. To bypass this restriction, AuthManager now creates a Message object
directly, does not escape the reason, and uses the resulting object to create a Status
object from.

Now the reason is not escaped on Special:CreateAccount anymore, like on most other
special pages.

The read-only message on the protection form is, also before this commit, not escaped and
already displayed correctly, as the read-only is checked in the constructor of the
protection form already and, if the Wiki is read only, handled as a permission error and
already displayed correctly. This commit fixes the behavior of WikiPage in case of it's used
somewhere else, subclassed or if the check in the frontend will be removed and the Status of
WikiPage will be used.

Bug: T157036
Change-Id: Idbfe556fcb90f8bda8fae9d728ca9dee5ea02f67
2017-08-28 17:51:17 +02:00
..
AbstractAuthenticationProviderTest.php Switch to librarized version of TestingAccessWrapper 2017-04-20 14:15:57 +00:00
AbstractPasswordPrimaryAuthenticationProviderTest.php Switch to librarized version of TestingAccessWrapper 2017-04-20 14:15:57 +00:00
AbstractPreAuthenticationProviderTest.php Remove $wgDisableAuthManager 2016-08-09 23:00:27 +00:00
AbstractPrimaryAuthenticationProviderTest.php phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
AbstractSecondaryAuthenticationProviderTest.php phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
AuthenticationRequestTest.php phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
AuthenticationRequestTestCase.php AuthManager: Allow for flagging fields as "sensitive" 2016-08-18 19:36:29 +00:00
AuthenticationResponseTest.php Show warnings in HTMLForm and warnings as warnings on Login/Signup form 2016-09-17 16:33:39 +02:00
AuthManagerTest.php Consistent behavior of read-only reason 2017-08-28 17:51:17 +02:00
AuthPluginPrimaryAuthenticationProviderTest.php phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
ButtonAuthenticationRequestTest.php
CheckBlocksSecondaryAuthenticationProviderTest.php Switch to librarized version of TestingAccessWrapper 2017-04-20 14:15:57 +00:00
ConfirmLinkAuthenticationRequestTest.php
ConfirmLinkSecondaryAuthenticationProviderTest.php Switch to librarized version of TestingAccessWrapper 2017-04-20 14:15:57 +00:00
CreatedAccountAuthenticationRequestTest.php
CreateFromLoginAuthenticationRequestTest.php AuthManager fixups around the login→RESTART→create flow 2016-05-31 11:44:02 -04:00
CreationReasonAuthenticationRequestTest.php
EmailNotificationSecondaryAuthenticationProviderTest.php Switch to librarized version of TestingAccessWrapper 2017-04-20 14:15:57 +00:00
LegacyHookPreAuthenticationProviderTest.php Use correct variable name in @param documentation 2017-08-11 19:27:19 +02:00
LocalPasswordPrimaryAuthenticationProviderTest.php clone keyword must not be used as a function 2017-06-28 16:29:33 +02:00
PasswordAuthenticationRequestTest.php
PasswordDomainAuthenticationRequestTest.php
RememberMeAuthenticationRequestTest.php Switch to librarized version of TestingAccessWrapper 2017-04-20 14:15:57 +00:00
ResetPasswordSecondaryAuthenticationProviderTest.php Switch to librarized version of TestingAccessWrapper 2017-04-20 14:15:57 +00:00
TemporaryPasswordAuthenticationRequestTest.php
TemporaryPasswordPrimaryAuthenticationProviderTest.php clone keyword must not be used as a function 2017-06-28 16:29:33 +02:00
ThrottlePreAuthenticationProviderTest.php Switch to librarized version of TestingAccessWrapper 2017-04-20 14:15:57 +00:00
ThrottlerTest.php Switch to librarized version of TestingAccessWrapper 2017-04-20 14:15:57 +00:00
UserDataAuthenticationRequestTest.php Remove empty lines at end of functions 2016-11-05 11:55:10 +01:00
UsernameAuthenticationRequestTest.php