Merge branch 'MDL-60018-master' of git://github.com/jleyva/moodle

This commit is contained in:
Dan Poltawski
2017-09-19 07:27:48 +01:00
2 changed files with 8 additions and 2 deletions
+2 -1
View File
@@ -594,7 +594,8 @@ class mod_chat_external extends external_api {
'intro' => new external_value(PARAM_RAW, 'The Chat intro'),
'introformat' => new external_format_value('intro'),
'introfiles' => new external_files('Files in the introduction text', VALUE_OPTIONAL),
'chatmethod' => new external_value(PARAM_ALPHA, 'chat method (sockets, daemon)', VALUE_OPTIONAL),
'chatmethod' => new external_value(PARAM_PLUGIN, 'chat method (sockets, ajax, header_js)',
VALUE_OPTIONAL),
'keepdays' => new external_value(PARAM_INT, 'keep days', VALUE_OPTIONAL),
'studentlogs' => new external_value(PARAM_INT, 'student logs visible to everyone', VALUE_OPTIONAL),
'chattime' => new external_value(PARAM_INT, 'chat time', VALUE_OPTIONAL),
+6 -1
View File
@@ -223,9 +223,13 @@ class mod_chat_external_testcase extends externallib_advanced_testcase {
* Test get_chats_by_courses
*/
public function test_get_chats_by_courses() {
global $DB, $USER;
global $DB, $USER, $CFG;
$this->resetAfterTest(true);
$this->setAdminUser();
// Set global chat method.
$CFG->chat_method = 'header_js';
$course1 = self::getDataGenerator()->create_course();
$chatoptions1 = array(
'course' => $course1->id,
@@ -272,6 +276,7 @@ class mod_chat_external_testcase extends externallib_advanced_testcase {
$this->assertCount(1, $chats['chats']);
$this->assertEquals('Second Chat', $chats['chats'][0]['name']);
$this->assertEquals('header_js', $chats['chats'][0]['chatmethod']);
// We see 17 fields.
$this->assertCount(17, $chats['chats'][0]);
// As an Admin you can see some chat properties like 'section'.