Permalink
Browse files

MDL-37420 add support for db schemas in enrol test

  • Loading branch information...
1 parent 543fc34 commit a668f57e75f00f8ac5c50f7e9c0ae3de2f3ded25 @skodak skodak committed Jan 8, 2013
Showing with 10 additions and 2 deletions.
  1. +10 −2 enrol/database/tests/sync_test.php
@@ -107,7 +107,11 @@ protected function init_enrol_database() {
$dbman->drop_table($table);
}
$dbman->create_table($table);
- set_config('remoteenroltable', $CFG->prefix.'enrol_database_test_enrols', 'enrol_database');
+ if (!empty($CFG->dboptions['dbschema'])) {
+ set_config('remoteenroltable', $CFG->dboptions['dbschema'].'.'.$CFG->prefix.'enrol_database_test_enrols', 'enrol_database');
+ } else {
+ set_config('remoteenroltable', $CFG->prefix.'enrol_database_test_enrols', 'enrol_database');
+ }
set_config('remotecoursefield', 'courseid', 'enrol_database');
set_config('remoteuserfield', 'userid', 'enrol_database');
set_config('remoterolefield', 'roleid', 'enrol_database');
@@ -123,7 +127,11 @@ protected function init_enrol_database() {
$dbman->drop_table($table);
}
$dbman->create_table($table);
- set_config('newcoursetable', $CFG->prefix.'enrol_database_test_courses', 'enrol_database');
+ if (!empty($CFG->dboptions['dbschema'])) {
+ set_config('newcoursetable', $CFG->dboptions['dbschema'].'.'.$CFG->prefix.'enrol_database_test_courses', 'enrol_database');
+ } else {
+ set_config('newcoursetable', $CFG->prefix.'enrol_database_test_courses', 'enrol_database');
+ }
set_config('newcoursefullname', 'fullname', 'enrol_database');
set_config('newcourseshortname', 'shortname', 'enrol_database');
set_config('newcourseidnumber', 'idnumber', 'enrol_database');

0 comments on commit a668f57

Please sign in to comment.