}
/**
+ * Overrides specific user permissions until services are reloaded
*
* @since 1.34
+ *
+ * @param User $user
+ * @param string[]|string $permissions
+ *
+ * @throws Exception
+ */
+ public function overrideUserPermissions( $user, $permissions = [] ) {
+ MediaWikiServices::getInstance()->getPermissionManager()->overrideUserRightsForTesting(
+ $user,
+ $permissions
+ );
+ }
+
+ /**
* Sets the logger for a specified channel, for the duration of the test.
* @since 1.27
* @param string $channel