aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/User.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/User.php b/includes/User.php
index fa489b36f7ca..685bce741fda 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -4000,7 +4000,9 @@ class User {
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];
}