mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-74106 reportbuilder: handle non-recurring schedules properly.
When a schedule is created with "No recurrence", it should only be sent when both conditions are true: it's start time is after the current time; and the time it was last sent is before it's start time (either 0/never sent; or a time it was manually sent).
This commit is contained in:
parent
1d99ba19a2
commit
2916f89d12
2 changed files with 22 additions and 1 deletions
|
@ -300,10 +300,25 @@ class schedule_test extends advanced_testcase {
|
|||
'recurrence' => model::RECURRENCE_NONE,
|
||||
'timescheduled' => $yesterday,
|
||||
], true],
|
||||
'Time scheduled in the past, already sent prior to schedule' => [[
|
||||
'recurrence' => model::RECURRENCE_NONE,
|
||||
'timescheduled' => $yesterday,
|
||||
'timelastsent' => $yesterday - HOURSECS,
|
||||
], true],
|
||||
'Time scheduled in the past, already sent on schedule' => [[
|
||||
'recurrence' => model::RECURRENCE_NONE,
|
||||
'timescheduled' => $yesterday,
|
||||
'timelastsent' => $yesterday,
|
||||
], false],
|
||||
'Time scheduled in the future' => [[
|
||||
'recurrence' => model::RECURRENCE_NONE,
|
||||
'timescheduled' => $tomorrow,
|
||||
], false],
|
||||
'Time scheduled in the future, already sent prior to schedule' => [[
|
||||
'recurrence' => model::RECURRENCE_NONE,
|
||||
'timelastsent' => $yesterday,
|
||||
'timescheduled' => $tomorrow,
|
||||
], false],
|
||||
'Next send in the past' => [[
|
||||
'recurrence' => model::RECURRENCE_DAILY,
|
||||
'timescheduled' => $yesterday,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue