MDL-39087 Add missing unit tests for the plugin_manager
This patch improves and adds unit tests for the plugin_manager class. These unit tests cover the existing functionalities. Tests for the new features related directly with MDL-38259 will be added in a separate commit (to make it clear what's related to it).
This commit is contained in:
+13
-1
@@ -298,7 +298,7 @@ class plugin_manager {
|
||||
* @return plugininfo_base|null the corresponding plugin information.
|
||||
*/
|
||||
public function get_plugin_info($component) {
|
||||
list($type, $name) = normalize_component($component);
|
||||
list($type, $name) = $this->normalize_component($component);
|
||||
$plugins = $this->get_plugins();
|
||||
if (isset($plugins[$type][$name])) {
|
||||
return $plugins[$type][$name];
|
||||
@@ -744,6 +744,18 @@ class plugin_manager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for the core function {@link normalize_component()}.
|
||||
*
|
||||
* This is here just to make it possible to mock it in unit tests.
|
||||
*
|
||||
* @param string $component
|
||||
* @return array
|
||||
*/
|
||||
protected function normalize_component($component) {
|
||||
return normalize_component($component);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reorders plugin types into a sequence to be displayed
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user