mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merge branch 'MDL-67798-master-fix' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
c9a5ccccf0
1 changed files with 12 additions and 4 deletions
|
@ -105,8 +105,12 @@ class core_contentbank_privacy_testcase extends provider_testcase {
|
||||||
// Get the userlist to Context Course, Manager and Teacher will be there.
|
// Get the userlist to Context Course, Manager and Teacher will be there.
|
||||||
$userlist = new userlist($scenario->coursecontext, 'core_contentbank');
|
$userlist = new userlist($scenario->coursecontext, 'core_contentbank');
|
||||||
provider::get_users_in_context($userlist);
|
provider::get_users_in_context($userlist);
|
||||||
$this->assertEquals([$scenario->manager->id, $scenario->teacher->id],
|
|
||||||
$userlist->get_userids());
|
$expected = [$scenario->manager->id, $scenario->teacher->id];
|
||||||
|
sort($expected);
|
||||||
|
$actual = $userlist->get_userids();
|
||||||
|
sort($actual);
|
||||||
|
$this->assertEquals($expected, $actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -223,9 +227,13 @@ class core_contentbank_privacy_testcase extends provider_testcase {
|
||||||
$userlist2 = new userlist($scenario->coursecontext, 'core_contentbank');
|
$userlist2 = new userlist($scenario->coursecontext, 'core_contentbank');
|
||||||
provider::get_users_in_context($userlist2);
|
provider::get_users_in_context($userlist2);
|
||||||
$this->assertCount(2, $userlist2);
|
$this->assertCount(2, $userlist2);
|
||||||
|
|
||||||
// Manager and Teacher should be.
|
// Manager and Teacher should be.
|
||||||
$this->assertEquals([$scenario->manager->id, $scenario->teacher->id],
|
$expected = [$scenario->manager->id, $scenario->teacher->id];
|
||||||
$userlist2->get_userids());
|
sort($expected);
|
||||||
|
$actual = $userlist2->get_userids();
|
||||||
|
sort($actual);
|
||||||
|
$this->assertEquals($expected, $actual);
|
||||||
|
|
||||||
// Convert $userlist1 into an approved_contextlist.
|
// Convert $userlist1 into an approved_contextlist.
|
||||||
$approvedlist1 = new approved_userlist($scenario->coursecategorycontext, 'core_contentbank', $userlist1->get_userids());
|
$approvedlist1 = new approved_userlist($scenario->coursecategorycontext, 'core_contentbank', $userlist1->get_userids());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue