MDL-65782 roles: allow several roles with user/frontpage archetype

This commit is contained in:
Marina Glancy 2019-05-29 11:53:13 +02:00
parent 29c395187f
commit 5ecbc5d9f7
5 changed files with 8 additions and 13 deletions

View file

@ -76,7 +76,7 @@ class tool_lp_external_testcase extends externallib_advanced_testcase {
* Setup function- we will create a course and add an assign instance to it.
*/
protected function setUp() {
global $DB;
global $DB, $CFG;
$this->resetAfterTest(true);
@ -91,9 +91,7 @@ class tool_lp_external_testcase extends externallib_advanced_testcase {
$catcontext = context_coursecat::instance($category->id);
// Fetching default authenticated user role.
$userroles = get_archetype_roles('user');
$this->assertCount(1, $userroles);
$authrole = array_pop($userroles);
$authrole = $DB->get_record('role', array('id' => $CFG->defaultuserroleid));
// Reset all default authenticated users permissions.
unassign_capability('moodle/competency:competencygrade', $authrole->id);