This may have some overlap with #295559: Cannot create user with permissions for contrib modules. but I think it is a distinct issue:

Problem:

I've got a situation where creating new configurations for imports create new permissions (e. g. "import [newtype] feeds"). checkPermissions() fails to verify these permissions created on the fly.

Analysis:

I *think* this happens because checkPermissions uses module_invoke_all('perm') to collect all available permissions but module_invoke_all('perm') gathers from the system that executes the tests - not the tested system that actually contains these permissions.

Is this analysis correct? What's the way to deal with this problem?

Comments

boombatower’s picture

Assigned: Unassigned » boombatower
Status: Active » Postponed (maintainer needs more info)

It shouldn't load the permissions until someone tries to create a user in a test and thus it does it in the tested environment.

Please try adding the following to your test before you create the user.

$this->checkPermissions(array(), TRUE);

If that fixes it then it is simply not refreshing and maybe we want a different solution.

boombatower’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Please re-ropen with more details. Been over a month with no response.