From 5afac432f5388afa8f2e709d7f956cd3f39fd874 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Thu, 2 Jan 2020 00:06:40 +0100 Subject: [PATCH] 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. --- calendar/tests/externallib_test.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/calendar/tests/externallib_test.php b/calendar/tests/externallib_test.php index acf2294b794..fc5ea7ec35c 100644 --- a/calendar/tests/externallib_test.php +++ b/calendar/tests/externallib_test.php @@ -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')); }