Merge branch 'MDL-79586-master' of https://github.com/safatshahin/moodle

This commit is contained in:
Ilya Tregubov 2023-10-06 10:25:39 +08:00
commit 2b4041f93c
No known key found for this signature in database
GPG key ID: 0F58186F748E55C1
3 changed files with 6 additions and 25 deletions

View file

@ -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;
}

View file

@ -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.
*