mirror of
https://github.com/moodle/moodle.git
synced 2025-03-23 17:10:20 +01:00
Merge branch 'MDL-65335_master' of https://github.com/marxjohnson/moodle
This commit is contained in:
commit
7dbc1041b3
@ -402,7 +402,6 @@ class api {
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_enabled() {
|
||||
$plugininfo = \core_plugin_manager::instance()->get_plugin_info('auth_oauth2');
|
||||
return $plugininfo->is_enabled();
|
||||
return is_enabled_auth('oauth2');
|
||||
}
|
||||
}
|
||||
|
@ -140,4 +140,23 @@ class auth_oauth2_external_testcase extends advanced_testcase {
|
||||
$this->assertEquals($newuser->id, $match->get('userid'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that is_enabled correctly identifies when the plugin is enabled.
|
||||
*/
|
||||
public function test_is_enabled() {
|
||||
$this->resetAfterTest();
|
||||
|
||||
set_config('auth', 'manual,oauth2');
|
||||
$this->assertTrue(\auth_oauth2\api::is_enabled());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that is_enabled correctly identifies when the plugin is disabled.
|
||||
*/
|
||||
public function test_is_enabled_disabled() {
|
||||
$this->resetAfterTest();
|
||||
|
||||
set_config('auth', 'manual');
|
||||
$this->assertFalse(\auth_oauth2\api::is_enabled());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user