jenkins-bot has submitted this change and it was merged. Change subject: Revert "Add AvailableRightsTest for User::getAllRights completeness" ......................................................................
Revert "Add AvailableRightsTest for User::getAllRights completeness" This change has not been advertised and cause random extensions to start failing giving little clue to users. Please have this change discussed on wikitech-l and announced ahead of time to minimize disruptions. It brokes MathSearch at least: https://gerrit.wikimedia.org/r/#/c/189442/ This reverts commit d333cd8f7be190d7e296721caa79478ab7ef1b20. Change-Id: If9a28b1386fca946d8ba351c16134cdf7da8a148 --- M includes/User.php D tests/phpunit/structure/AvailableRightsTest.php 2 files changed, 1 insertion(+), 46 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/User.php b/includes/User.php index 961c510..c2db67a 100644 --- a/includes/User.php +++ b/includes/User.php @@ -4399,7 +4399,7 @@ /** * Get a list of all available permissions. - * @return string[] Array of permission names + * @return array Array of permission names */ public static function getAllRights() { if ( self::$mAllRights === false ) { diff --git a/tests/phpunit/structure/AvailableRightsTest.php b/tests/phpunit/structure/AvailableRightsTest.php deleted file mode 100644 index 9737e82..0000000 --- a/tests/phpunit/structure/AvailableRightsTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/** - * Try to make sure that extensions register all rights in $wgAvailableRights - * or via the 'UserGetAllRights' hook. - * - * @author Marius Hoch < [email protected] > - */ -class AvailableRightsTest extends PHPUnit_Framework_TestCase { - - /** - * Returns all rights that should be in $wgAvailableRights + all rights - * registered via the 'UserGetAllRights' hook + all "core" rights. - * - * @return string[] - */ - private function getAllVisibleRights() { - global $wgGroupPermissions, $wgRevokePermissions; - - $rights = User::getAllRights(); - - foreach( $wgGroupPermissions as $permissions ) { - $rights = array_merge( $rights, array_keys( $permissions ) ); - } - - foreach( $wgRevokePermissions as $permissions ) { - $rights = array_merge( $rights, array_keys( $permissions ) ); - } - - $rights = array_unique( $rights ); - sort( $rights ); - - return $rights; - } - - public function testAvailableRights() { - $missingRights = array_diff( $this->getAllVisibleRights(), User::getAllRights() ); - - $this->assertEquals( - array(), - array_values( $missingRights ), // Re-Index to produce nicer output, keys are meaningless - 'Additional user rights need to be added to $wgAvailableRights or via the "UserGetAllRights" hook' - ); - } -} -- To view, visit https://gerrit.wikimedia.org/r/189960 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If9a28b1386fca946d8ba351c16134cdf7da8a148 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Hashar <[email protected]> Gerrit-Reviewer: Aude <[email protected]> Gerrit-Reviewer: Hashar <[email protected]> Gerrit-Reviewer: Hoo man <[email protected]> Gerrit-Reviewer: Physikerwelt <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
