mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-61308 assignsubmission_comments: Unit test ordering fix.
This commit is contained in:
parent
7085e286c0
commit
bfb57d2c16
1 changed files with 11 additions and 2 deletions
|
@ -164,9 +164,18 @@ class assignsubmission_comments_privacy_testcase extends \mod_assign\tests\mod_a
|
||||||
$exportdata = new \mod_assign\privacy\assign_plugin_request_data($context, $assign, $submission);
|
$exportdata = new \mod_assign\privacy\assign_plugin_request_data($context, $assign, $submission);
|
||||||
\assignsubmission_comments\privacy\provider::export_submission_user_data($exportdata);
|
\assignsubmission_comments\privacy\provider::export_submission_user_data($exportdata);
|
||||||
$exportedcomments = $writer->get_data(['Comments']);
|
$exportedcomments = $writer->get_data(['Comments']);
|
||||||
|
|
||||||
|
// Can't rely on these comments coming out in order.
|
||||||
|
if ($exportedcomments->comments[0]->userid == $user1->id) {
|
||||||
|
$exportedstudentcomment = $exportedcomments->comments[0]->content;
|
||||||
|
$exportedteachercomment = $exportedcomments->comments[1]->content;
|
||||||
|
} else {
|
||||||
|
$exportedstudentcomment = $exportedcomments->comments[1]->content;
|
||||||
|
$exportedteachercomment = $exportedcomments->comments[0]->content;
|
||||||
|
}
|
||||||
$this->assertCount(2, $exportedcomments->comments);
|
$this->assertCount(2, $exportedcomments->comments);
|
||||||
$this->assertContains($studentcomment, $exportedcomments->comments[0]->content);
|
$this->assertContains($studentcomment, $exportedstudentcomment);
|
||||||
$this->assertContains($teachercomment, $exportedcomments->comments[1]->content);
|
$this->assertContains($teachercomment, $exportedteachercomment);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue