MDL-62425 tool_dataprivacy: Add core to the list of components

This commit is contained in:
Andrew Nicols
2018-05-14 15:41:30 +08:00
parent 66f2da2e0a
commit b5b86c298c
2 changed files with 6 additions and 1 deletions
@@ -122,11 +122,15 @@ class metadata_registry {
* @return array An array of plugin types which contain plugin data.
*/
protected function get_full_component_list() {
global $CFG;
$list = \core_component::get_component_list();
$list['core']['core'] = "{$CFG->dirroot}/lib";
$formattedlist = [];
foreach ($list as $plugintype => $plugin) {
$formattedlist[] = ['plugin_type' => $plugintype, 'plugins' => array_keys($plugin)];
}
return $formattedlist;
}
@@ -72,8 +72,9 @@ class tool_dataprivacy_metadata_registry_testcase extends advanced_testcase {
}
// Let's check core subsystems.
// The Privacy API adds an extra component in the form of 'core'.
$coresubsystems = \core_component::get_core_subsystems();
$this->assertEquals(count($coresubsystems), count($data['core']));
$this->assertEquals(count($coresubsystems) + 1, count($data['core']));
}
/**