Merge branch 'MDL-52530' of git://github.com/eugeneventer/moodle-fixes

This commit is contained in:
David Monllao 2015-12-29 14:05:42 +08:00
commit 1c042d38ea
2 changed files with 4 additions and 4 deletions

View File

@ -327,8 +327,8 @@ class core_files_file_storage_testcase extends advanced_testcase {
$repositorypluginname = 'user';
// Override repository permission.
$capability = 'repository/' . $repositorypluginname . ':view';
$allroles = $DB->get_records_menu('role', array(), 'id', 'archetype, id');
assign_capability($capability, CAP_ALLOW, $allroles['guest'], $syscontext->id, true);
$guestroleid = $DB->get_field('role', 'id', array('shortname' => 'guest'));
assign_capability($capability, CAP_ALLOW, $guestroleid, $syscontext->id, true);
$args = array();
$args['type'] = $repositorypluginname;

View File

@ -44,8 +44,8 @@ class core_repositorylib_testcase extends advanced_testcase {
$repositorypluginname = 'boxnet';
// override repository permission
$capability = 'repository/' . $repositorypluginname . ':view';
$allroles = $DB->get_records_menu('role', array(), 'id', 'archetype, id');
assign_capability($capability, CAP_ALLOW, $allroles['guest'], $syscontext->id, true);
$guestroleid = $DB->get_field('role', 'id', array('shortname' => 'guest'));
assign_capability($capability, CAP_ALLOW, $guestroleid, $syscontext->id, true);
$plugintype = new repository_type($repositorypluginname);
$pluginid = $plugintype->create(false);