Skip to content

Commit

Permalink
MDL-54866 tool_mobile: Rename WS get_site_public_settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jleyva committed Oct 4, 2016
1 parent 6b49262 commit 7c1cb3b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion admin/tool/mobile/classes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static function get_plugins_supporting_mobile() {
*
* @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();
Expand Down
12 changes: 6 additions & 6 deletions admin/tool/mobile/classes/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ public static function get_plugins_supporting_mobile_returns() {
}

/**
* 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());
}

Expand All @@ -111,19 +111,19 @@ public static function get_site_public_settings_parameters() {
* @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.'),
Expand Down
4 changes: 2 additions & 2 deletions admin/tool/mobile/db/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
'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),
Expand Down
10 changes: 5 additions & 5 deletions admin/tool/mobile/tests/externallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public function test_get_plugins_supporting_mobile() {
$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();
Expand Down Expand Up @@ -95,8 +95,8 @@ public function test_get_site_public_settings() {
$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);
}

Expand Down

0 comments on commit 7c1cb3b

Please sign in to comment.