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.
This commit is contained in:
Jun Pataleta 2024-08-20 17:58:36 +08:00 committed by Huong Nguyen
parent 6e3bb56ef6
commit e19837463b

View File

@ -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);