mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-79586-master' of https://github.com/safatshahin/moodle
This commit is contained in:
commit
2b4041f93c
@ -178,7 +178,10 @@ class api {
|
||||
$selection[processor::PROVIDER_NONE] = get_string('nocommunicationselected', 'communication');
|
||||
$communicationplugins = \core\plugininfo\communication::get_enabled_plugins();
|
||||
foreach ($communicationplugins as $pluginname => $notusing) {
|
||||
$selection['communication_' . $pluginname] = get_string('pluginname', 'communication_' . $pluginname);
|
||||
$provider = 'communication_' . $pluginname;
|
||||
if (processor::is_provider_available($provider)) {
|
||||
$selection[$provider] = get_string('pluginname', 'communication_' . $pluginname);
|
||||
}
|
||||
}
|
||||
return $selection;
|
||||
}
|
||||
|
@ -43,17 +43,6 @@ class api_test extends \advanced_testcase {
|
||||
$this->initialise_mock_server();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the communication plugin list for the form element returns the correct number of plugins.
|
||||
*/
|
||||
public function test_get_communication_plugin_list_for_form(): void {
|
||||
$communicationplugins = \core_communication\api::get_communication_plugin_list_for_form();
|
||||
// Get the communication plugins.
|
||||
$plugins = \core_component::get_plugin_list('communication');
|
||||
// Check the number of plugins matches plus 1 as we have none in the selection.
|
||||
$this->assertCount(count($plugins) + 1, $communicationplugins);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test set data to the instance.
|
||||
*/
|
||||
@ -296,18 +285,6 @@ class api_test extends \advanced_testcase {
|
||||
$this->assertCount(1, $adhoctask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the enabled communication plugin list and default.
|
||||
*/
|
||||
public function test_get_enabled_providers_and_default(): void {
|
||||
[$communicationproviders, $defaulprovider] = \core_communication\api::get_enabled_providers_and_default();
|
||||
// Get the communication plugins.
|
||||
$plugins = \core_component::get_plugin_list('communication');
|
||||
// Check the number of plugins matches plus 1 as we have none in the selection.
|
||||
$this->assertCount(count($plugins) + 1, $communicationproviders);
|
||||
$this->assertEquals(processor::PROVIDER_NONE, $defaulprovider);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the update of room membership with the change user role.
|
||||
*
|
||||
|
@ -78,7 +78,8 @@ class communication extends base {
|
||||
// Filter to return only enabled plugins.
|
||||
$enabled = [];
|
||||
foreach ($plugins as $plugin) {
|
||||
if (processor::is_provider_available('communication_' . $plugin)) {
|
||||
$disabled = get_config('communication_' . $plugin, 'disabled');
|
||||
if (empty($disabled)) {
|
||||
$enabled[$plugin] = $plugin;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user