From e00f1c663c11e2df1c8261052045aa9895d51864 Mon Sep 17 00:00:00 2001 From: Mathew May Date: Thu, 28 Feb 2019 13:42:23 +0800 Subject: [PATCH] MDL-64506 phpunit: Update unit tests to use classic --- admin/cli/cfg.php | 2 +- .../templates/cohort-in-list.mustache | 2 +- admin/tool/uploadcourse/tests/course_test.php | 4 ++-- .../usertours/tests/theme_filter_test.php | 6 ++--- cohort/tests/behat/upload_cohorts.feature | 14 +++++------ cohort/tests/cohortlib_test.php | 10 ++++---- cohort/tests/externallib_test.php | 16 ++++++------- cohort/tests/fixtures/uploadcohorts4.csv | 4 ++-- course/tests/externallib_test.php | 6 ++--- lib/classes/plugin_manager.php | 9 +++---- lib/classes/plugininfo/theme.php | 2 +- lib/outputlib.php | 6 +---- lib/tests/admintree_test.php | 10 ++++---- lib/tests/blocklib_test.php | 2 +- lib/tests/formslib_test.php | 13 ++++------ lib/tests/moodle_page_test.php | 20 ++++++++-------- lib/tests/mustache_template_finder_test.php | 24 +++++++++---------- lib/tests/outputcomponents_test.php | 6 ++--- lib/tests/upgradelib_test.php | 7 +++--- lib/tests/user_menu_test.php | 2 +- lib/tests/user_test.php | 4 ++-- user/tests/userlib_test.php | 4 ++-- webservice/tests/externallib_test.php | 2 +- 23 files changed, 84 insertions(+), 91 deletions(-) diff --git a/admin/cli/cfg.php b/admin/cli/cfg.php index 463a0ab2ea1..7f56b926cb9 100644 --- a/admin/cli/cfg.php +++ b/admin/cli/cfg.php @@ -83,7 +83,7 @@ Examples: Stores the given configuration variable in the shell variable, escaped so that it can be safely used as a shell argument. - # php cfg.php --name=theme --set=clean + # php cfg.php --name=theme --set=classic Sets the given configuration variable to the given value. # php cfg.php --name=noemailever --unset diff --git a/admin/tool/cohortroles/templates/cohort-in-list.mustache b/admin/tool/cohortroles/templates/cohort-in-list.mustache index ff2199c3915..4400345d943 100644 --- a/admin/tool/cohortroles/templates/cohort-in-list.mustache +++ b/admin/tool/cohortroles/templates/cohort-in-list.mustache @@ -39,7 +39,7 @@ "visible": true, "idnumber": "014", "description": "Some users", - "theme": "clean" + "theme": "classic" } }} {{> tool_lp/form-cohort-selector-suggestion }} diff --git a/admin/tool/uploadcourse/tests/course_test.php b/admin/tool/uploadcourse/tests/course_test.php index 4896658807f..092469fc364 100644 --- a/admin/tool/uploadcourse/tests/course_test.php +++ b/admin/tool/uploadcourse/tests/course_test.php @@ -403,7 +403,7 @@ class tool_uploadcourse_course_testcase extends advanced_testcase { 'idnumber' => 'changeidn', 'summary' => 'Summary 2', 'format' => 'topics', - 'theme' => 'clean', + 'theme' => 'classic', 'lang' => '', 'newsitems' => '2', 'showgrades' => '1', @@ -566,7 +566,7 @@ class tool_uploadcourse_course_testcase extends advanced_testcase { 'idnumber' => 'changedid', 'summary' => 'Summary 2', 'format' => 'topics', - 'theme' => 'clean', + 'theme' => 'classic', 'lang' => '', 'newsitems' => '2', 'showgrades' => '1', diff --git a/admin/tool/usertours/tests/theme_filter_test.php b/admin/tool/usertours/tests/theme_filter_test.php index 547f571643d..75ede939286 100644 --- a/admin/tool/usertours/tests/theme_filter_test.php +++ b/admin/tool/usertours/tests/theme_filter_test.php @@ -56,17 +56,17 @@ class tool_usertours_theme_filter_testcase extends advanced_testcase { true, ], 'Multiple values set including matching; Matches' => [ - ['boost', 'clean'], + ['boost', 'classic'], 'boost', true, ], 'Single value set; No match' => [ - ['clean'], + ['classic'], 'boost', false, ], 'Multiple values set; No match' => [ - ['clean', 'artificial'], + ['classic', 'artificial'], 'boost', false, ], diff --git a/cohort/tests/behat/upload_cohorts.feature b/cohort/tests/behat/upload_cohorts.feature index 73ef61d2304..c94e2625bde 100644 --- a/cohort/tests/behat/upload_cohorts.feature +++ b/cohort/tests/behat/upload_cohorts.feature @@ -170,13 +170,13 @@ Feature: A privileged user can create cohorts using a CSV file And I upload "cohort/tests/fixtures/uploadcohorts4.csv" file to "File" filemanager And I click on "Preview" "button" Then the following should exist in the "previewuploadedcohorts" table: - | name | idnumber | description | Context | visible | theme | Status | - | cohort name 1 | cohortid1 | first description | System | 1 | boost | | - | cohort name 2 | cohortid2 | | System | 1 | | | - | cohort name 3 | cohortid3 | | Miscellaneous | 0 | boost | | - | cohort name 4 | cohortid4 | | Cat 1 | 1 | clean | | - | cohort name 5 | cohortid5 | | Cat 2 | 0 | | | - | cohort name 6 | cohortid6 | | Cat 3 | 1 | clean | | + | name | idnumber | description | Context | visible | theme | Status | + | cohort name 1 | cohortid1 | first description | System | 1 | boost | | + | cohort name 2 | cohortid2 | | System | 1 | | | + | cohort name 3 | cohortid3 | | Miscellaneous | 0 | boost | | + | cohort name 4 | cohortid4 | | Cat 1 | 1 | classic | | + | cohort name 5 | cohortid5 | | Cat 2 | 0 | | | + | cohort name 6 | cohortid6 | | Cat 3 | 1 | classic | | And I press "Upload cohorts" And I should see "Uploaded 6 cohorts" And I press "Continue" diff --git a/cohort/tests/cohortlib_test.php b/cohort/tests/cohortlib_test.php index e92c2649072..e48fdf5f825 100644 --- a/cohort/tests/cohortlib_test.php +++ b/cohort/tests/cohortlib_test.php @@ -671,7 +671,7 @@ class core_cohort_cohortlib_testcase extends advanced_testcase { $systemctx = context_system::instance(); $cohort1 = $this->getDataGenerator()->create_cohort(array('contextid' => $systemctx->id, 'name' => 'test cohort 1', - 'idnumber' => 'testid1', 'description' => 'test cohort desc', 'descriptionformat' => FORMAT_HTML, 'theme' => 'clean')); + 'idnumber' => 'testid1', 'description' => 'test cohort desc', 'descriptionformat' => FORMAT_HTML, 'theme' => 'classic')); $id = cohort_add_cohort($cohort1); $this->assertNotEmpty($id); @@ -690,7 +690,7 @@ class core_cohort_cohortlib_testcase extends advanced_testcase { set_config('allowcohortthemes', 0); $cohort2 = $this->getDataGenerator()->create_cohort(array('contextid' => $systemctx->id, 'name' => 'test cohort 2', - 'idnumber' => 'testid2', 'description' => 'test cohort desc', 'descriptionformat' => FORMAT_HTML, 'theme' => 'clean')); + 'idnumber' => 'testid2', 'description' => 'test cohort desc', 'descriptionformat' => FORMAT_HTML, 'theme' => 'classic')); $id = cohort_add_cohort($cohort2); $this->assertNotEmpty($id); @@ -713,14 +713,14 @@ class core_cohort_cohortlib_testcase extends advanced_testcase { $systemctx = context_system::instance(); $cohort1 = $this->getDataGenerator()->create_cohort(array('contextid' => $systemctx->id, 'name' => 'test cohort 1', - 'idnumber' => 'testid1', 'description' => 'test cohort desc', 'descriptionformat' => FORMAT_HTML, 'theme' => 'clean')); + 'idnumber' => 'testid1', 'description' => 'test cohort desc', 'descriptionformat' => FORMAT_HTML, 'theme' => 'classic')); $id = cohort_add_cohort($cohort1); $this->assertNotEmpty($id); // Theme is updated when allowcohortthemes is enabled. $cohort1 = $DB->get_record('cohort', array('id' => $id)); $cohort1->name = 'test cohort 1 updated'; - $cohort1->theme = 'more'; + $cohort1->theme = 'classic'; cohort_update_cohort($cohort1); $updatedcohort = $DB->get_record('cohort', array('id' => $id)); $this->assertEquals($cohort1->contextid, $updatedcohort->contextid); @@ -732,7 +732,7 @@ class core_cohort_cohortlib_testcase extends advanced_testcase { // Theme is not updated neither overwritten when allowcohortthemes is disabled. set_config('allowcohortthemes', 0); $cohort2 = $DB->get_record('cohort', array('id' => $id)); - $cohort2->theme = 'clean'; + $cohort2->theme = 'classic'; cohort_update_cohort($cohort2); $updatedcohort = $DB->get_record('cohort', array('id' => $id)); $this->assertEquals($cohort2->contextid, $updatedcohort->contextid); diff --git a/cohort/tests/externallib_test.php b/cohort/tests/externallib_test.php index a6717b87b11..b8fd082a257 100644 --- a/cohort/tests/externallib_test.php +++ b/cohort/tests/externallib_test.php @@ -52,7 +52,7 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase { 'name' => 'cohort test 1', 'idnumber' => 'cohorttest1', 'description' => 'This is a description for cohorttest1', - 'theme' => 'clean' + 'theme' => 'classic' ); $cohort2 = array( @@ -76,7 +76,7 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase { 'name' => 'cohort test 4', 'idnumber' => 'cohorttest4', 'description' => 'This is a description for cohorttest4', - 'theme' => 'clean' + 'theme' => 'classic' ); // Call the external function. @@ -182,7 +182,7 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase { 'name' => 'cohortnametest1', 'idnumber' => 'idnumbertest1', 'description' => 'This is a description for cohort 1', - 'theme' => 'clean' + 'theme' => 'classic' ); $cohort1 = self::getDataGenerator()->create_cohort($cohort1); $cohort2 = self::getDataGenerator()->create_cohort(); @@ -250,7 +250,7 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase { 'name' => 'cohortnametest1', 'idnumber' => 'idnumbertest1', 'description' => 'This is a description for cohort 1', - 'theme' => 'clean' + 'theme' => 'classic' ); $context = context_system::instance(); @@ -279,15 +279,15 @@ class core_cohort_externallib_testcase extends externallib_advanced_testcase { // Call when $CFG->allowcohortthemes is enabled. set_config('allowcohortthemes', 1); - core_cohort_external::update_cohorts(array($cohort1 + array('theme' => 'clean'))); + core_cohort_external::update_cohorts(array($cohort1 + array('theme' => 'classic'))); $dbcohort = $DB->get_record('cohort', array('id' => $cohort1['id'])); - $this->assertEquals('clean', $dbcohort->theme); + $this->assertEquals('classic', $dbcohort->theme); // Call when $CFG->allowcohortthemes is disabled. set_config('allowcohortthemes', 0); - core_cohort_external::update_cohorts(array($cohort1 + array('theme' => 'more'))); + core_cohort_external::update_cohorts(array($cohort1 + array('theme' => 'boost'))); $dbcohort = $DB->get_record('cohort', array('id' => $cohort1['id'])); - $this->assertEquals('clean', $dbcohort->theme); + $this->assertEquals('classic', $dbcohort->theme); // Call without required capability. $this->unassignUserCapability('moodle/cohort:manage', $context->id, $roleid); diff --git a/cohort/tests/fixtures/uploadcohorts4.csv b/cohort/tests/fixtures/uploadcohorts4.csv index 1aba4ccd42a..61dc609c656 100644 --- a/cohort/tests/fixtures/uploadcohorts4.csv +++ b/cohort/tests/fixtures/uploadcohorts4.csv @@ -2,6 +2,6 @@ name,idnumber,description,category,visible,theme cohort name 1,cohortid1,first description,,,boost cohort name 2,cohortid2,,,, cohort name 3,cohortid3,,Miscellaneous,no,boost -cohort name 4,cohortid4,,CAT1,yes,clean +cohort name 4,cohortid4,,CAT1,yes,classic cohort name 5,cohortid5,,CAT2,0, -cohort name 6,cohortid6,,CAT3,1,clean +cohort name 6,cohortid6,,CAT3,1,classic diff --git a/course/tests/externallib_test.php b/course/tests/externallib_test.php index ad77f90a026..d504e7a93c4 100644 --- a/course/tests/externallib_test.php +++ b/course/tests/externallib_test.php @@ -67,7 +67,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $category2->name = 'Root Test Category 2'; $category2->idnumber = 'rootcattest2'; $category2->desc = 'Description for root test category 1'; - $category2->theme = 'bootstrapbase'; + $category2->theme = 'classic'; $categories = array( array('name' => $category1->name, 'parent' => 0), array('name' => $category2->name, 'parent' => 0, 'idnumber' => $category2->idnumber, @@ -451,7 +451,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $course2['enablecompletion'] = 1; $course2['completionnotify'] = 1; $course2['lang'] = 'en'; - $course2['forcetheme'] = 'bootstrapbase'; + $course2['forcetheme'] = 'classic'; $course2['courseformatoptions'][] = array('name' => 'automaticenddate', 'value' => 0); $course3['fullname'] = 'Test course 3'; $course3['shortname'] = 'Testcourse3'; @@ -1438,7 +1438,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $course2['defaultgroupingid'] = 0; $course2['enablecompletion'] = 1; $course2['lang'] = 'en'; - $course2['forcetheme'] = 'bootstrapbase'; + $course2['forcetheme'] = 'classic'; $course3['id'] = $originalcourse3->id; $updatedcustomfieldvalue = ['shortname' => 'test', 'value' => 'Updated test value']; diff --git a/lib/classes/plugin_manager.php b/lib/classes/plugin_manager.php index 3c6301b6595..6438fa2550e 100644 --- a/lib/classes/plugin_manager.php +++ b/lib/classes/plugin_manager.php @@ -1654,9 +1654,10 @@ class core_plugin_manager { 'repository' => array('alfresco'), 'tinymce' => array('dragmath'), 'tool' => array('bloglevelupgrade', 'qeupgradehelper', 'timezoneimport', 'assignmentupgrade'), - 'theme' => array('afterburner', 'anomaly', 'arialist', 'base', 'binarius', 'boxxie', 'brick', 'canvas', - 'formal_white', 'formfactor', 'fusion', 'leatherbound', 'magazine', 'mymobile', 'nimble', 'nonzero', - 'overlay', 'serenity', 'sky_high', 'splash', 'standard', 'standardold'), + 'theme' => array('bootstrapbase', 'clean', 'more', 'afterburner', 'anomaly', 'arialist', 'base', + 'binarius', 'boxxie', 'brick', 'canvas', 'formal_white', 'formfactor', 'fusion', 'leatherbound', + 'magazine', 'mymobile', 'nimble', 'nonzero', 'overlay', 'serenity', 'sky_high', 'splash', + 'standard', 'standardold'), 'webservice' => array('amf'), ); @@ -1905,7 +1906,7 @@ class core_plugin_manager { ), 'theme' => array( - 'boost', 'classic', 'bootstrapbase', 'clean', 'more' + 'boost', 'classic' ), 'tool' => array( diff --git a/lib/classes/plugininfo/theme.php b/lib/classes/plugininfo/theme.php index 332ff1e6431..fbc1125ceeb 100644 --- a/lib/classes/plugininfo/theme.php +++ b/lib/classes/plugininfo/theme.php @@ -34,7 +34,7 @@ class theme extends base { public function is_uninstall_allowed() { global $CFG; - if ($this->name === 'bootstrapbase') { + if ($this->name === 'boost') { // All of these are protected for now. return false; } diff --git a/lib/outputlib.php b/lib/outputlib.php index b0079f6f28c..a33c3584840 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -739,11 +739,7 @@ class theme_config { $this->name = $config->name; $this->dir = $config->dir; - if ($this->name != 'bootstrapbase') { - $baseconfig = theme_config::find_theme_config('bootstrapbase', $this->settings); - } else { - $baseconfig = $config; - } + $baseconfig = $config; $configurable = array( 'parents', 'sheets', 'parents_exclude_sheets', 'plugins_exclude_sheets', 'usefallback', diff --git a/lib/tests/admintree_test.php b/lib/tests/admintree_test.php index a4a51f298b4..cadd817046c 100644 --- a/lib/tests/admintree_test.php +++ b/lib/tests/admintree_test.php @@ -155,20 +155,20 @@ class core_admintree_testcase extends advanced_testcase { global $CFG; $this->resetAfterTest(); - $CFG->theme = 'clean'; + $CFG->theme = 'classic'; $executable = new admin_setting_configexecutable('test1', 'Text 1', 'Help Path', ''); // Check for an invalid path. $result = $executable->output_html($CFG->dirroot . '/lib/tests/other/file_does_not_exist'); - $this->assertRegexp('/class="patherror"/', $result); + $this->assertRegexp('/class="text-danger"/', $result); // Check for a directory. $result = $executable->output_html($CFG->dirroot); - $this->assertRegexp('/class="patherror"/', $result); + $this->assertRegexp('/class="text-danger"/', $result); // Check for a file which is not executable. $result = $executable->output_html($CFG->dirroot . '/filter/tex/readme_moodle.txt'); - $this->assertRegexp('/class="patherror"/', $result); + $this->assertRegexp('/class="text-danger"/', $result); // Check for an executable file. if ($CFG->ostype == 'WINDOWS') { @@ -177,7 +177,7 @@ class core_admintree_testcase extends advanced_testcase { $filetocheck = 'mimetex.darwin'; } $result = $executable->output_html($CFG->dirroot . '/filter/tex/' . $filetocheck); - $this->assertRegexp('/class="pathok"/', $result); + $this->assertRegexp('/class="text-success"/', $result); // Check for no file specified. $result = $executable->output_html(''); diff --git a/lib/tests/blocklib_test.php b/lib/tests/blocklib_test.php index 664abc65968..1cf455261c9 100644 --- a/lib/tests/blocklib_test.php +++ b/lib/tests/blocklib_test.php @@ -607,7 +607,7 @@ class core_blocklib_testcase extends advanced_testcase { $PAGE->reset_theme_and_output(); // Change to a theme with undeletable blocks. - $CFG->theme = 'clean'; + $CFG->theme = 'classic'; list($page, $blockmanager) = $this->get_a_page_and_block_manager(array($regionname), $context, 'page-type'); diff --git a/lib/tests/formslib_test.php b/lib/tests/formslib_test.php index 2587997e921..50024b2a57c 100644 --- a/lib/tests/formslib_test.php +++ b/lib/tests/formslib_test.php @@ -558,23 +558,23 @@ class core_formslib_testcase extends advanced_testcase { global $CFG; $this->resetAfterTest(true); - $CFG->theme = 'clean'; + $CFG->theme = 'classic'; $form = new formslib_multiple_modgrade_form(); ob_start(); $form->display(); $html = ob_get_clean(); - $this->assertTag(array('id' => 'fgroup_id_grade1'), $html); + $this->assertTag(array('id' => 'fitem_fgroup_id_grade1'), $html); $this->assertTag(array('id' => 'id_grade1_modgrade_type'), $html); $this->assertTag(array('id' => 'id_grade1_modgrade_point'), $html); $this->assertTag(array('id' => 'id_grade1_modgrade_scale'), $html); - $this->assertTag(array('id' => 'fgroup_id_grade2'), $html); + $this->assertTag(array('id' => 'fitem_fgroup_id_grade2'), $html); $this->assertTag(array('id' => 'id_grade2_modgrade_type'), $html); $this->assertTag(array('id' => 'id_grade2_modgrade_point'), $html); $this->assertTag(array('id' => 'id_grade2_modgrade_scale'), $html); - $this->assertTag(array('id' => 'fgroup_id_grade_3'), $html); + $this->assertTag(array('id' => 'fitem_fgroup_id_grade_3'), $html); $this->assertTag(array('id' => 'id_grade_3_modgrade_type'), $html); $this->assertTag(array('id' => 'id_grade_3_modgrade_point'), $html); $this->assertTag(array('id' => 'id_grade_3_modgrade_scale'), $html); @@ -586,7 +586,7 @@ class core_formslib_testcase extends advanced_testcase { public function test_persistantrreeze_element() { global $CFG; $this->resetAfterTest(true); - $CFG->theme = 'clean'; + $CFG->theme = 'classic'; $form = new formslib_persistantrreeze_element(); ob_start(); @@ -595,15 +595,12 @@ class core_formslib_testcase extends advanced_testcase { // Test advcheckbox id's. $this->assertTag(array('id' => 'id_advcheckboxpersistant'), $html); - $this->assertTag(array('id' => 'id_advcheckboxpersistant_persistant'), $html); $this->assertTag(array('id' => 'id_advcheckboxnotpersistant'), $html); $this->assertNotTag(array('id' => 'id_advcheckboxnotpersistant_persistant'), $html); $this->assertTag(array('id' => 'id_advcheckboxfrozen'), $html); - $this->assertTag(array('id' => 'id_advcheckboxfrozen_persistant'), $html); // Check text element id's. $this->assertTag(array('id' => 'id_textpersistant'), $html); - $this->assertTag(array('id' => 'id_textpersistant_persistant'), $html); $this->assertTag(array('id' => 'id_textnotpersistant'), $html); $this->assertNotTag(array('id' => 'id_textnotpersistant_persistant'), $html); $this->assertTag(array('id' => 'id_textfrozen'), $html); diff --git a/lib/tests/moodle_page_test.php b/lib/tests/moodle_page_test.php index 514b3b13007..a801a623c99 100644 --- a/lib/tests/moodle_page_test.php +++ b/lib/tests/moodle_page_test.php @@ -733,41 +733,41 @@ class core_moodle_page_testcase extends advanced_testcase { 'usertheme' => '', 'sitetheme' => 'boost', 'cohorts' => [ - 'clean', + 'classic', ], - 'expected' => 'clean', + 'expected' => 'classic', ], 'User member of one cohort which has a theme set, and one without a theme' => [ 'usertheme' => '', 'sitetheme' => 'boost', 'cohorts' => [ - 'clean', + 'classic', '', ], - 'expected' => 'clean', + 'expected' => 'classic', ], 'User member of one cohort which has a theme set, and one with a different theme' => [ 'usertheme' => '', 'sitetheme' => 'boost', 'cohorts' => [ - 'clean', + 'classic', 'someother', ], 'expected' => 'boost', ], 'User with a theme but not a member of any cohort' => [ - 'usertheme' => 'more', + 'usertheme' => 'classic', 'sitetheme' => 'boost', 'cohorts' => [], - 'expected' => 'more', + 'expected' => 'classic', ], 'User with a theme and member of one cohort which has a theme set' => [ - 'usertheme' => 'more', + 'usertheme' => 'classic', 'sitetheme' => 'boost', 'cohorts' => [ - 'clean', + 'boost', ], - 'expected' => 'more', + 'expected' => 'classic', ], ]; } diff --git a/lib/tests/mustache_template_finder_test.php b/lib/tests/mustache_template_finder_test.php index df3237e9ed5..87dc59715c7 100644 --- a/lib/tests/mustache_template_finder_test.php +++ b/lib/tests/mustache_template_finder_test.php @@ -37,33 +37,33 @@ class core_output_mustache_template_finder_testcase extends advanced_testcase { global $CFG; // Test a plugin. - $dirs = mustache_template_finder::get_template_directories_for_component('mod_assign', 'clean'); + $dirs = mustache_template_finder::get_template_directories_for_component('mod_assign', 'classic'); $correct = array( - 'theme/clean/templates/mod_assign/', - 'theme/bootstrapbase/templates/mod_assign/', + 'theme/classic/templates/mod_assign/', + 'theme/boost/templates/mod_assign/', 'mod/assign/templates/' ); foreach ($dirs as $index => $dir) { $this->assertSame($dir, $CFG->dirroot . '/' . $correct[$index]); } // Test a subsystem. - $dirs = mustache_template_finder::get_template_directories_for_component('core_user', 'clean'); + $dirs = mustache_template_finder::get_template_directories_for_component('core_user', 'classic'); $correct = array( - 'theme/clean/templates/core_user/', - 'theme/bootstrapbase/templates/core_user/', + 'theme/classic/templates/core_user/', + 'theme/boost/templates/core_user/', 'user/templates/' ); foreach ($dirs as $index => $dir) { $this->assertSame($dir, $CFG->dirroot . '/' . $correct[$index]); } // Test core. - $dirs = mustache_template_finder::get_template_directories_for_component('core', 'clean'); + $dirs = mustache_template_finder::get_template_directories_for_component('core', 'classic'); $correct = array( - 'theme/clean/templates/core/', - 'theme/bootstrapbase/templates/core/', + 'theme/classic/templates/core/', + 'theme/boost/templates/core/', 'lib/templates/' ); foreach ($dirs as $index => $dir) { @@ -77,13 +77,13 @@ class core_output_mustache_template_finder_testcase extends advanced_testcase { */ public function test_invalid_get_template_directories_for_component() { // Test something invalid. - $dirs = mustache_template_finder::get_template_directories_for_component('octopus', 'clean'); + $dirs = mustache_template_finder::get_template_directories_for_component('octopus', 'classic'); } public function test_get_template_filepath() { global $CFG; - $filename = mustache_template_finder::get_template_filepath('core/pix_icon', 'clean'); + $filename = mustache_template_finder::get_template_filepath('core/pix_icon', 'classic'); $correct = $CFG->dirroot . '/lib/templates/pix_icon.mustache'; $this->assertSame($correct, $filename); } @@ -93,6 +93,6 @@ class core_output_mustache_template_finder_testcase extends advanced_testcase { */ public function test_invalid_get_template_filepath() { // Test something invalid. - $dirs = mustache_template_finder::get_template_filepath('core/octopus', 'clean'); + $dirs = mustache_template_finder::get_template_filepath('core/octopus', 'classic'); } } diff --git a/lib/tests/outputcomponents_test.php b/lib/tests/outputcomponents_test.php index 705b04cb31d..077a1ffb0f7 100644 --- a/lib/tests/outputcomponents_test.php +++ b/lib/tests/outputcomponents_test.php @@ -268,7 +268,7 @@ class core_outputcomponents_testcase extends advanced_testcase { // $this->assertSame($CFG->wwwroot.'/theme/image.php/formal_white/core/1/u/f2', $up2->get_url($page, $renderer)->out(false)); // Test non-slashargument images. - set_config('theme', 'clean'); + set_config('theme', 'classic'); $CFG->wwwroot = str_replace('https:', 'http:', $CFG->wwwroot); $CFG->slasharguments = 0; $page = new moodle_page(); @@ -277,7 +277,7 @@ class core_outputcomponents_testcase extends advanced_testcase { $renderer = $page->get_renderer('core'); $up3 = new user_picture($user3); - $this->assertSame($CFG->wwwroot.'/theme/image.php?theme=clean&component=core&rev=1&image=u%2Ff2', $up3->get_url($page, $renderer)->out(false)); + $this->assertSame($CFG->wwwroot.'/theme/image.php?theme=classic&component=core&rev=1&image=u%2Ff2', $up3->get_url($page, $renderer)->out(false)); } public function test_empty_menu() { @@ -454,7 +454,7 @@ EOF; $this->assertNotContains('aria-hidden="true"', $renderer->pix_icon('t/print', 'Print'), $reason); // Test another theme with a different icon system. - set_config('theme', 'clean'); + set_config('theme', 'classic'); // Need to reset after changing theme. $page->reset_theme_and_output(); $renderer = $page->get_renderer('core'); diff --git a/lib/tests/upgradelib_test.php b/lib/tests/upgradelib_test.php index 360bed62e7e..61c29af3b0e 100644 --- a/lib/tests/upgradelib_test.php +++ b/lib/tests/upgradelib_test.php @@ -794,8 +794,7 @@ class core_upgradelib_testcase extends advanced_testcase { $CFG->themedir = $this->create_testthemes(); $this->assertSame($CFG->dirroot . '/theme/boost', upgrade_find_theme_location('boost')); - $this->assertSame($CFG->dirroot . '/theme/clean', upgrade_find_theme_location('clean')); - $this->assertSame($CFG->dirroot . '/theme/bootstrapbase', upgrade_find_theme_location('bootstrapbase')); + $this->assertSame($CFG->dirroot . '/theme/classic', upgrade_find_theme_location('classic')); $this->assertSame($CFG->themedir . '/testtheme', upgrade_find_theme_location('testtheme')); $this->assertSame($CFG->themedir . '/childoftesttheme', upgrade_find_theme_location('childoftesttheme')); @@ -812,8 +811,8 @@ class core_upgradelib_testcase extends advanced_testcase { $CFG->themedir = $this->create_testthemes(); $this->assertTrue(upgrade_theme_is_from_family('boost', 'boost'), 'Boost is a boost theme'); - $this->assertTrue(upgrade_theme_is_from_family('bootstrapbase', 'clean'), 'Clean is a bootstrap base theme'); - $this->assertFalse(upgrade_theme_is_from_family('boost', 'clean'), 'Clean is not a boost theme'); + $this->assertTrue(upgrade_theme_is_from_family('boost', 'classic'), 'Classic is a boost base theme'); + $this->assertFalse(upgrade_theme_is_from_family('classic', 'boost'), 'Boost is not a classic theme'); $this->assertTrue(upgrade_theme_is_from_family('testtheme', 'childoftesttheme'), 'childoftesttheme is a testtheme'); $this->assertFalse(upgrade_theme_is_from_family('testtheme', 'orphantheme'), 'ofphantheme is not a testtheme'); diff --git a/lib/tests/user_menu_test.php b/lib/tests/user_menu_test.php index 1e9d2905cb0..19bc9c7b92b 100644 --- a/lib/tests/user_menu_test.php +++ b/lib/tests/user_menu_test.php @@ -85,7 +85,7 @@ test // Test using an admin user at the root of Moodle; this way we don't have to create a test user with avatar. $this->setAdminUser(); $PAGE->set_url('/'); - $CFG->theme = 'clean'; + $CFG->theme = 'classic'; $PAGE->reset_theme_and_output(); $PAGE->initialise_theme_and_output(); diff --git a/lib/tests/user_test.php b/lib/tests/user_test.php index 155719da33f..6777f1f9caf 100644 --- a/lib/tests/user_test.php +++ b/lib/tests/user_test.php @@ -658,8 +658,8 @@ class core_user_testcase extends advanced_testcase { // Test against theme property choices. $choices = core_user::get_property_choices('theme'); - $this->assertArrayHasKey('bootstrapbase', $choices); - $this->assertArrayHasKey('clean', $choices); + $this->assertArrayHasKey('boost', $choices); + $this->assertArrayHasKey('classic', $choices); $this->assertArrayNotHasKey('unknowntheme', $choices); $this->assertArrayNotHasKey('wrongtheme', $choices); diff --git a/user/tests/userlib_test.php b/user/tests/userlib_test.php index 9dc3c32293e..ef2e92f7653 100644 --- a/user/tests/userlib_test.php +++ b/user/tests/userlib_test.php @@ -147,7 +147,7 @@ class core_userliblib_testcase extends advanced_testcase { $user->auth = 'shibboleth'; $user->country = 'AU'; $user->lang = 'en'; - $user->theme = 'clean'; + $user->theme = 'classic'; $user->timezone = 'Australia/Perth'; $user->url = 'www.moodle.org'; user_update_user($user, true, false); @@ -234,7 +234,7 @@ class core_userliblib_testcase extends advanced_testcase { $user['auth'] = 'shibboleth'; $user['country'] = 'AU'; $user['lang'] = 'en'; - $user['theme'] = 'clean'; + $user['theme'] = 'classic'; $user['timezone'] = 'Australia/Perth'; $user['url'] = 'www.moodle.org'; user_create_user($user, true, false); diff --git a/webservice/tests/externallib_test.php b/webservice/tests/externallib_test.php index 91ffdfa4a77..b8c72bbe849 100644 --- a/webservice/tests/externallib_test.php +++ b/webservice/tests/externallib_test.php @@ -54,7 +54,7 @@ class core_webservice_externallib_testcase extends externallib_advanced_testcase $user['username'] = 'johnd'; $user['firstname'] = 'John'; $user['lastname'] = 'Doe'; - $user['theme'] = 'more'; + $user['theme'] = 'boost'; self::setUser(self::getDataGenerator()->create_user($user)); // Add a web service and token. -- 2.43.0