MDL-35998 get_site_info return current_language()

This commit is contained in:
Jerome Mouneyrac 2012-11-02 18:03:20 +08:00
parent 489987af77
commit 92fa81d387
2 changed files with 3 additions and 0 deletions

View File

@ -87,6 +87,7 @@ class core_webservice_external extends external_api {
'firstname' => $USER->firstname,
'lastname' => $USER->lastname,
'fullname' => fullname($USER),
'lang' => current_language(),
'userid' => $USER->id,
'userpictureurl' => $profileimageurl->out(false)
);
@ -175,6 +176,7 @@ class core_webservice_external extends external_api {
'firstname' => new external_value(PARAM_TEXT, 'first name'),
'lastname' => new external_value(PARAM_TEXT, 'last name'),
'fullname' => new external_value(PARAM_TEXT, 'user full name'),
'lang' => new external_value(PARAM_LANG, 'user language'),
'userid' => new external_value(PARAM_INT, 'user id'),
'siteurl' => new external_value(PARAM_RAW, 'site url'),
'userpictureurl' => new external_value(PARAM_URL, 'the user profile picture.

View File

@ -80,6 +80,7 @@ class core_webservice_external_testcase extends externallib_advanced_testcase {
$this->assertEquals('johnd', $siteinfo['username']);
$this->assertEquals('John', $siteinfo['firstname']);
$this->assertEquals('Doe', $siteinfo['lastname']);
$this->assertEquals(current_language(), $siteinfo['lang']);
$this->assertEquals($USER->id, $siteinfo['userid']);
$this->assertEquals(true, $siteinfo['downloadfiles']);
$this->assertEquals($CFG->release, $siteinfo['release']);