Extension unit tests depend on being able to change these
mid-request (that would never happen during normal usage).
Change-Id: Ic32da022cf774341631686e6345969acc1aa5055
global $wgGroupPermissions, $wgRevokePermissions;
static $cache = array();
- if ( isset( $cache[$right] ) ) {
+ // Use the cached results, except in unit tests which rely on
+ // being able change the permission mid-request
+ if ( isset( $cache[$right] ) && !defined( 'MW_PHPUNIT_TEST' ) ) {
return $cache[$right];
}