Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 45... Línea 45...
45
        // Chat module is disabled by default, enable it for testing.
45
        // Chat module is disabled by default, enable it for testing.
46
        $manager = \core_plugin_manager::resolve_plugininfo_class('mod');
46
        $manager = \core_plugin_manager::resolve_plugininfo_class('mod');
47
        $manager::enable_plugin('chat', 1);
47
        $manager::enable_plugin('chat', 1);
48
    }
48
    }
Línea 49... Línea 49...
49
 
49
 
50
    public function test_message_sent() {
50
    public function test_message_sent(): void {
51
        global $DB;
51
        global $DB;
Línea 52... Línea 52...
52
        $this->resetAfterTest();
52
        $this->resetAfterTest();
53
 
53
 
Línea 104... Línea 104...
104
        $this->assertEquals(0, $sink->count());
104
        $this->assertEquals(0, $sink->count());
Línea 105... Línea 105...
105
 
105
 
106
        $sink->close();
106
        $sink->close();
Línea 107... Línea 107...
107
    }
107
    }
108
 
108
 
109
    public function test_sessions_viewed() {
109
    public function test_sessions_viewed(): void {
Línea 110... Línea 110...
110
        global $USER;
110
        global $USER;
111
        $this->resetAfterTest();
111
        $this->resetAfterTest();
Línea 137... Línea 137...
137
        $this->assertEquals(5678, $event->other['end']);
137
        $this->assertEquals(5678, $event->other['end']);
138
        $this->assertEquals($chat->id, $event->objectid);
138
        $this->assertEquals($chat->id, $event->objectid);
139
        $this->assertEquals($chat, $event->get_record_snapshot('chat', $chat->id));
139
        $this->assertEquals($chat, $event->get_record_snapshot('chat', $chat->id));
140
    }
140
    }
Línea 141... Línea 141...
141
 
141
 
142
    public function test_course_module_instance_list_viewed() {
142
    public function test_course_module_instance_list_viewed(): void {
143
        global $USER;
143
        global $USER;
Línea 144... Línea 144...
144
        $this->resetAfterTest();
144
        $this->resetAfterTest();
145
 
145
 
Línea 159... Línea 159...
159
        $this->assertInstanceOf('\mod_chat\event\course_module_instance_list_viewed', $event);
159
        $this->assertInstanceOf('\mod_chat\event\course_module_instance_list_viewed', $event);
160
        $this->assertEquals($USER->id, $event->userid);
160
        $this->assertEquals($USER->id, $event->userid);
161
        $this->assertEquals(\context_course::instance($course->id), $event->get_context());
161
        $this->assertEquals(\context_course::instance($course->id), $event->get_context());
162
    }
162
    }
Línea 163... Línea 163...
163
 
163
 
164
    public function test_course_module_viewed() {
164
    public function test_course_module_viewed(): void {
165
        $this->resetAfterTest();
165
        $this->resetAfterTest();
166
        $this->setAdminUser();
166
        $this->setAdminUser();
167
        $course = $this->getDataGenerator()->create_course();
167
        $course = $this->getDataGenerator()->create_course();
168
        $chat = $this->getDataGenerator()->create_module('chat', array('course' => $course->id));
168
        $chat = $this->getDataGenerator()->create_module('chat', array('course' => $course->id));