MDL-66970 analytics: Extra testing for active enrolments

I sneaked in an unrelated change to enrol-partly-active-ends-afterwards
test case as the endtime and enrolment timestart values were swapped.
The case when the enrolment start is after the analysis end is already
tested in enrol-after-end test case.
This commit is contained in:
David Monllaó 2019-10-21 08:56:10 +08:00
parent b00d35a6fc
commit b4bb8688a5

View File

@ -272,8 +272,8 @@ class core_analytics_targets_testcase extends advanced_testcase {
],
'enrol-partly-active-ends-afterwards' => [
'starttime' => $now,
'endtime' => $now + (WEEKSECS * 9),
'timestart' => $now + (WEEKSECS * 10),
'endtime' => $now + (WEEKSECS * 10),
'timestart' => $now + (WEEKSECS * 9),
'timeend' => $now + (WEEKSECS * 11),
'nullcalculation' => true,
],
@ -291,12 +291,33 @@ class core_analytics_targets_testcase extends advanced_testcase {
'timeend' => false,
'nullcalculation' => true,
],
'enrol-mostly-active-no-enrolment-end' => [
'enrol-mostly-active-no-enrolment-end-false' => [
'starttime' => $now,
'endtime' => $now + (WEEKSECS * 10),
'timestart' => $now + WEEKSECS,
'timeend' => false,
'nullcalculation' => true,
'nullcalculation' => false,
],
'enrol-mostly-active-no-enrolment-end-zero' => [
'starttime' => $now,
'endtime' => $now + (WEEKSECS * 10),
'timestart' => $now + WEEKSECS,
'timeend' => 0,
'nullcalculation' => false,
],
'enrol-no-enrolment-start-false' => [
'starttime' => $now,
'endtime' => $now + (WEEKSECS * 10),
'timestart' => false,
'timeend' => $now + (WEEKSECS * 9),
'nullcalculation' => false,
],
'enrol-no-enrolment-start-zero' => [
'starttime' => $now,
'endtime' => $now + (WEEKSECS * 10),
'timestart' => 0,
'timeend' => $now + (WEEKSECS * 9),
'nullcalculation' => false,
],
'no-start' => [
'starttime' => 0,