mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 04:33:13 +01:00
Merge branch 'mdl83310' of https://github.com/danmarsden/moodle
This commit is contained in:
commit
f332842df1
@ -7504,7 +7504,7 @@ class courselib_test extends advanced_testcase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests get_sorted_course_formats returns all plugins in cases where plugins are installed now,
|
||||
* Tests get_sorted_course_formats returns plugins in cases where plugins are
|
||||
* installed previously but no longer exist, or not installed yet.
|
||||
*
|
||||
* @covers ::get_sorted_course_formats()
|
||||
@ -7514,10 +7514,6 @@ class courselib_test extends advanced_testcase {
|
||||
|
||||
$this->resetAfterTest();
|
||||
|
||||
// By default returns all course formats.
|
||||
$formats = get_sorted_course_formats();
|
||||
$this->assertEquals(['topics', 'weeks', 'singleactivity', 'social'], $formats);
|
||||
|
||||
// If there is an extra format installed that no longer exists, include in list (at end).
|
||||
$DB->insert_record('config_plugins', [
|
||||
'plugin' => 'format_frogs',
|
||||
@ -7526,12 +7522,12 @@ class courselib_test extends advanced_testcase {
|
||||
]);
|
||||
\core\plugin_manager::reset_caches();
|
||||
$formats = get_sorted_course_formats();
|
||||
$this->assertEquals(['topics', 'weeks', 'singleactivity', 'social', 'frogs'], $formats);
|
||||
$this->assertContains('frogs', $formats);
|
||||
|
||||
// If one of the formats is not installed yet, we still return it.
|
||||
$DB->delete_records('config_plugins', ['plugin' => 'format_weeks']);
|
||||
\core\plugin_manager::reset_caches();
|
||||
$formats = get_sorted_course_formats();
|
||||
$this->assertEquals(['topics', 'weeks', 'singleactivity', 'social', 'frogs'], $formats);
|
||||
$this->assertContains('weeks', $formats);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user