MDL-67598 unit tests: Pass day of month without leading zero

Note this fixes the unit tests. Still the calendar API itself
should be able to manage this cases, both casting (int) or
being stricter about what's allowed there (param hinting).

But that falls out from this issue and the code that introduced
the failures, so the pure unit-test fix has been applied.
This commit is contained in:
Eloy Lafuente (stronk7) 2020-01-02 00:06:40 +01:00
parent 7850f76a93
commit 5afac432f5

View File

@ -2372,7 +2372,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
$data = external_api::clean_returnvalue(
core_calendar_external::get_calendar_monthly_view_returns(),
core_calendar_external::get_calendar_monthly_view($timestart->format('Y'), $timestart->format('n'),
$course->id, null, false, true, $timestart->format('d'))
$course->id, null, false, true, $timestart->format('j'))
);
$this->assertEquals($data['courseid'], $course->id);
// User enrolled in the course can load the course calendar.
@ -2380,7 +2380,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
$data = external_api::clean_returnvalue(
core_calendar_external::get_calendar_monthly_view_returns(),
core_calendar_external::get_calendar_monthly_view($timestart->format('Y'), $timestart->format('n'),
$course->id, null, false, true, $timestart->format('d'))
$course->id, null, false, true, $timestart->format('j'))
);
$this->assertEquals($data['courseid'], $course->id);
// User not enrolled in the course cannot load the course calendar.
@ -2389,7 +2389,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
$data = external_api::clean_returnvalue(
core_calendar_external::get_calendar_monthly_view_returns(),
core_calendar_external::get_calendar_monthly_view($timestart->format('Y'), $timestart->format('n'),
$course->id, null, false, false, $timestart->format('d'))
$course->id, null, false, false, $timestart->format('j'))
);
}
@ -2404,7 +2404,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
$data = external_api::clean_returnvalue(
core_calendar_external::get_calendar_monthly_view_returns(),
core_calendar_external::get_calendar_monthly_view($timestart->format('Y'), $timestart->format('n'),
SITEID, null, false, true, $timestart->format('d'))
SITEID, null, false, true, $timestart->format('j'))
);
$this->assertEquals($data['date']['mday'], $timestart->format('d'));
}