mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-47815 assign: Fix random unit test fails
This test was failing when it was run really slowly (looking at you oracle).
This commit is contained in:
parent
e739fbcf27
commit
8112670d62
1 changed files with 6 additions and 2 deletions
|
@ -507,7 +507,7 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||||
// Create an assignment with a description that should be hidden.
|
// Create an assignment with a description that should be hidden.
|
||||||
$assign = $this->create_instance(array('duedate'=>$now + 160,
|
$assign = $this->create_instance(array('duedate'=>$now + 160,
|
||||||
'alwaysshowdescription'=>false,
|
'alwaysshowdescription'=>false,
|
||||||
'allowsubmissionsfromdate'=>$now+3,
|
'allowsubmissionsfromdate'=>$now + 60,
|
||||||
'intro'=>'Some text'));
|
'intro'=>'Some text'));
|
||||||
|
|
||||||
// Get the event from the calendar.
|
// Get the event from the calendar.
|
||||||
|
@ -515,7 +515,11 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||||
$event = $DB->get_record('event', $params);
|
$event = $DB->get_record('event', $params);
|
||||||
|
|
||||||
$this->assertEmpty($event->description);
|
$this->assertEmpty($event->description);
|
||||||
sleep(6);
|
|
||||||
|
// Change the allowsubmissionfromdate to the past - do this directly in the DB
|
||||||
|
// because if we call the assignment update method - it will update the calendar
|
||||||
|
// and we want to test that this works from cron.
|
||||||
|
$DB->set_field('assign', 'allowsubmissionsfromdate', $now - 60, array('id'=>$assign->get_instance()->id));
|
||||||
// Run cron to update the event in the calendar.
|
// Run cron to update the event in the calendar.
|
||||||
assign::cron();
|
assign::cron();
|
||||||
$event = $DB->get_record('event', $params);
|
$event = $DB->get_record('event', $params);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue