Merge branch 'MDL-63826' of git://github.com/stronk7/moodle
authorJun Pataleta <jun@moodle.com>
Thu, 1 Nov 2018 01:28:45 +0000 (09:28 +0800)
committerJun Pataleta <jun@moodle.com>
Thu, 1 Nov 2018 01:28:45 +0000 (09:28 +0800)
mod/assign/submission/comments/tests/privacy_test.php

index c02e795..e30e7ee 100644 (file)
@@ -174,9 +174,11 @@ class assignsubmission_comments_privacy_testcase extends \mod_assign\tests\mod_a
         \assignsubmission_comments\privacy\provider::get_userids_from_context($userlist);
         $userids = $userlist->get_userids();
         $this->assertCount(3, $userids);
-        // Two is the key for user 3.
-        $this->assertEquals(2, array_search($user3->id, $userids));
-        $this->assertFalse(array_search($user4->id, $userids));
+        // User 1,2 and 3 are the expected ones in the array. User 4 isn't.
+        $this->assertContains($user1->id, $userids);
+        $this->assertContains($user2->id, $userids);
+        $this->assertContains($user3->id, $userids);
+        $this->assertNotContains($user4->id, $userids);
     }
 
     /**