Merge branch 'MDL-60018-master' of git://github.com/jleyva/moodle
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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'.
|
||||
|
||||
Reference in New Issue
Block a user