mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
MDL-54866 tool_mobile: Rename WS get_site_public_settings
This commit is contained in:
parent
6b4926281b
commit
7c1cb3bf5a
@ -96,7 +96,7 @@ class api {
|
||||
*
|
||||
* @return array with the settings and warnings
|
||||
*/
|
||||
public static function get_site_public_settings() {
|
||||
public static function get_public_config() {
|
||||
global $CFG, $SITE, $PAGE;
|
||||
|
||||
$context = context_system::instance();
|
||||
|
@ -96,12 +96,12 @@ class external extends external_api {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns description of get_site_public_settings() parameters.
|
||||
* Returns description of get_public_config() parameters.
|
||||
*
|
||||
* @return external_function_parameters
|
||||
* @since Moodle 3.2
|
||||
*/
|
||||
public static function get_site_public_settings_parameters() {
|
||||
public static function get_public_config_parameters() {
|
||||
return new external_function_parameters(array());
|
||||
}
|
||||
|
||||
@ -111,19 +111,19 @@ class external extends external_api {
|
||||
* @return array with the settings and warnings
|
||||
* @since Moodle 3.2
|
||||
*/
|
||||
public static function get_site_public_settings() {
|
||||
$result = api::get_site_public_settings();
|
||||
public static function get_public_config() {
|
||||
$result = api::get_public_config();
|
||||
$result['warnings'] = array();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns description of get_site_public_settings() result value.
|
||||
* Returns description of get_public_config() result value.
|
||||
*
|
||||
* @return external_description
|
||||
* @since Moodle 3.2
|
||||
*/
|
||||
public static function get_site_public_settings_returns() {
|
||||
public static function get_public_config_returns() {
|
||||
return new external_single_structure(
|
||||
array(
|
||||
'wwwroot' => new external_value(PARAM_RAW, 'Site URL.'),
|
||||
|
@ -33,9 +33,9 @@ $functions = array(
|
||||
'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
|
||||
),
|
||||
|
||||
'tool_mobile_get_site_public_settings' => array(
|
||||
'tool_mobile_get_public_config' => array(
|
||||
'classname' => 'tool_mobile\external',
|
||||
'methodname' => 'get_site_public_settings',
|
||||
'methodname' => 'get_public_config',
|
||||
'description' => 'Returns a list of the site public settings, those not requiring authentication.',
|
||||
'type' => 'read',
|
||||
'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
|
||||
|
@ -55,12 +55,12 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
|
||||
$this->assertTrue(is_array($result['plugins']));
|
||||
}
|
||||
|
||||
public function test_get_site_public_settings() {
|
||||
public function test_get_public_config() {
|
||||
global $CFG, $SITE;
|
||||
|
||||
$this->resetAfterTest(true);
|
||||
$result = external::get_site_public_settings();
|
||||
$result = external_api::clean_returnvalue(external::get_site_public_settings_returns(), $result);
|
||||
$result = external::get_public_config();
|
||||
$result = external_api::clean_returnvalue(external::get_public_config_returns(), $result);
|
||||
|
||||
// Test default values.
|
||||
$context = context_system::instance();
|
||||
@ -95,8 +95,8 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
|
||||
$expected['typeoflogin'] = api::LOGIN_VIA_BROWSER;
|
||||
$expected['launchurl'] = "$CFG->wwwroot/$CFG->admin/tool/mobile/launch.php";;
|
||||
|
||||
$result = external::get_site_public_settings();
|
||||
$result = external_api::clean_returnvalue(external::get_site_public_settings_returns(), $result);
|
||||
$result = external::get_public_config();
|
||||
$result = external_api::clean_returnvalue(external::get_public_config_returns(), $result);
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user