Page MenuHomePhabricator

AvailableRightsTest::testAllActionsWithMessages and ::testAllRightsWithMessage failure message should point to documentation
Closed, ResolvedPublic

Description

The failure messages of AvailableRightsTest::testAllActionsWithMessages and ::testAllRightsWithMessage do not contain any link to the documentation or detailed explanations about the needed messages, for instance:

1) AvailableRightsTest::testAllActionsWithMessages
Each user right (core/extensions) has a corresponding action- message.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
+    85 => 'campaignevents-email-participants'
 )

/workspace/src/tests/phpunit/structure/AvailableRightsTest.php:102
/workspace/src/tests/phpunit/structure/AvailableRightsTest.php:65

2) AvailableRightsTest::testAllRightsWithMessage
Each user right (core/extensions) has a corresponding right- message.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
+    85 => 'campaignevents-email-participants'
 )

/workspace/src/tests/phpunit/structure/AvailableRightsTest.php:102
/workspace/src/tests/phpunit/structure/AvailableRightsTest.php:74

It would be great if the failure message also pointed to the documentation (https://www.mediawiki.org/wiki/Manual:User_rights#Adding_new_rights), so that newer contributors can read more on what they need to do when adding new user rights.

Event Timeline

Change 924495 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] AvailableRightsTest::checkMessagesExist: Point to doc, like testAvailableRights

https://gerrit.wikimedia.org/r/924495

Change 924495 merged by jenkins-bot:

[mediawiki/core@master] AvailableRightsTest::checkMessagesExist: Point to doc, like testAvailableRights

https://gerrit.wikimedia.org/r/924495