From e19837463b319bd2ed70af7fae2bcf4205d4fe9a Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Tue, 20 Aug 2024 17:58:36 +0800 Subject: [PATCH] MDL-77544 enrol_database: Make sure column mapping config match case Some databases may have case-sensitive collation that will cause the generated SQL query in `\enrol_database_plugin::sync_courses()` to fail when using values for the plugin settings `newcoursestartdate` and `newcourseenddate` with a different case compared to the columns in the actual external database table. For the sake of testing sync with start and end dates, let's make sure that the config values match the case of the enrol test table's columns for the start and end dates. --- enrol/database/tests/sync_test.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/enrol/database/tests/sync_test.php b/enrol/database/tests/sync_test.php index b1cbf7d2e10..a7723841d7a 100644 --- a/enrol/database/tests/sync_test.php +++ b/enrol/database/tests/sync_test.php @@ -860,9 +860,8 @@ class sync_test extends \advanced_testcase { $DB->insert_record('enrol_database_test_courses', $course8); $DB->insert_record('enrol_database_test_courses', $course9); - // Mess with case as we need to check that fields are lower cased. - $plugin->set_config('newcoursestartdate', 'StartDaTE'); - $plugin->set_config('newcourseenddate', 'ENDdATE'); + $plugin->set_config('newcoursestartdate', 'startdate'); + $plugin->set_config('newcourseenddate', 'enddate'); $plugin->sync_courses($trace);