| Línea 40... |
Línea 40... |
| 40 |
}
|
40 |
}
|
| Línea 41... |
Línea 41... |
| 41 |
|
41 |
|
| 42 |
/**
|
42 |
/**
|
| 43 |
* Test comment_created event.
|
43 |
* Test comment_created event.
|
| 44 |
*/
|
44 |
*/
|
| 45 |
public function test_comment_created() {
|
45 |
public function test_comment_created(): void {
|
| 46 |
global $CFG;
|
46 |
global $CFG;
|
| Línea 47... |
Línea 47... |
| 47 |
require_once($CFG->dirroot . '/comment/lib.php');
|
47 |
require_once($CFG->dirroot . '/comment/lib.php');
|
| 48 |
|
48 |
|
| Línea 82... |
Línea 82... |
| 82 |
}
|
82 |
}
|
| Línea 83... |
Línea 83... |
| 83 |
|
83 |
|
| 84 |
/**
|
84 |
/**
|
| 85 |
* Test comment_deleted event.
|
85 |
* Test comment_deleted event.
|
| 86 |
*/
|
86 |
*/
|
| 87 |
public function test_comment_deleted() {
|
87 |
public function test_comment_deleted(): void {
|
| 88 |
global $CFG;
|
88 |
global $CFG;
|
| Línea 89... |
Línea 89... |
| 89 |
require_once($CFG->dirroot . '/comment/lib.php');
|
89 |
require_once($CFG->dirroot . '/comment/lib.php');
|
| 90 |
|
90 |
|
| Línea 122... |
Línea 122... |
| 122 |
$url = new \moodle_url('/mod/glossary/view.php', array('id' => $glossary->cmid));
|
122 |
$url = new \moodle_url('/mod/glossary/view.php', array('id' => $glossary->cmid));
|
| 123 |
$this->assertEquals($url, $event->get_url());
|
123 |
$this->assertEquals($url, $event->get_url());
|
| 124 |
$this->assertEventContextNotUsed($event);
|
124 |
$this->assertEventContextNotUsed($event);
|
| 125 |
}
|
125 |
}
|
| Línea 126... |
Línea 126... |
| 126 |
|
126 |
|
| 127 |
public function test_course_module_viewed() {
|
127 |
public function test_course_module_viewed(): void {
|
| 128 |
global $DB;
|
128 |
global $DB;
|
| 129 |
// There is no proper API to call to trigger this event, so what we are
|
129 |
// There is no proper API to call to trigger this event, so what we are
|
| Línea 130... |
Línea 130... |
| 130 |
// doing here is simply making sure that the events returns the right information.
|
130 |
// doing here is simply making sure that the events returns the right information.
|
| Línea 160... |
Línea 160... |
| 160 |
$this->assertEquals($glossary->id, $event->objectid);
|
160 |
$this->assertEquals($glossary->id, $event->objectid);
|
| 161 |
$this->assertEquals(new \moodle_url('/mod/glossary/view.php', array('id' => $glossary->cmid, 'mode' => $mode)), $event->get_url());
|
161 |
$this->assertEquals(new \moodle_url('/mod/glossary/view.php', array('id' => $glossary->cmid, 'mode' => $mode)), $event->get_url());
|
| 162 |
$this->assertEventContextNotUsed($event);
|
162 |
$this->assertEventContextNotUsed($event);
|
| 163 |
}
|
163 |
}
|
| Línea 164... |
Línea 164... |
| 164 |
|
164 |
|
| 165 |
public function test_course_module_instance_list_viewed() {
|
165 |
public function test_course_module_instance_list_viewed(): void {
|
| 166 |
// There is no proper API to call to trigger this event, so what we are
|
166 |
// There is no proper API to call to trigger this event, so what we are
|
| Línea 167... |
Línea 167... |
| 167 |
// doing here is simply making sure that the events returns the right information.
|
167 |
// doing here is simply making sure that the events returns the right information.
|
| Línea 184... |
Línea 184... |
| 184 |
$this->assertEquals(CONTEXT_COURSE, $event->contextlevel);
|
184 |
$this->assertEquals(CONTEXT_COURSE, $event->contextlevel);
|
| 185 |
$this->assertEquals($course->id, $event->contextinstanceid);
|
185 |
$this->assertEquals($course->id, $event->contextinstanceid);
|
| 186 |
$this->assertEventContextNotUsed($event);
|
186 |
$this->assertEventContextNotUsed($event);
|
| 187 |
}
|
187 |
}
|
| Línea 188... |
Línea 188... |
| 188 |
|
188 |
|
| 189 |
public function test_entry_created() {
|
189 |
public function test_entry_created(): void {
|
| 190 |
// There is no proper API to call to trigger this event, so what we are
|
190 |
// There is no proper API to call to trigger this event, so what we are
|
| Línea 191... |
Línea 191... |
| 191 |
// doing here is simply making sure that the events returns the right information.
|
191 |
// doing here is simply making sure that the events returns the right information.
|
| 192 |
|
192 |
|
| Línea 217... |
Línea 217... |
| 217 |
$this->assertEquals(CONTEXT_MODULE, $event->contextlevel);
|
217 |
$this->assertEquals(CONTEXT_MODULE, $event->contextlevel);
|
| 218 |
$this->assertEquals($glossary->cmid, $event->contextinstanceid);
|
218 |
$this->assertEquals($glossary->cmid, $event->contextinstanceid);
|
| 219 |
$this->assertEventContextNotUsed($event);
|
219 |
$this->assertEventContextNotUsed($event);
|
| 220 |
}
|
220 |
}
|
| Línea 221... |
Línea 221... |
| 221 |
|
221 |
|
| 222 |
public function test_entry_updated() {
|
222 |
public function test_entry_updated(): void {
|
| 223 |
// There is no proper API to call to trigger this event, so what we are
|
223 |
// There is no proper API to call to trigger this event, so what we are
|
| Línea 224... |
Línea 224... |
| 224 |
// doing here is simply making sure that the events returns the right information.
|
224 |
// doing here is simply making sure that the events returns the right information.
|
| 225 |
|
225 |
|
| Línea 250... |
Línea 250... |
| 250 |
$this->assertEquals(CONTEXT_MODULE, $event->contextlevel);
|
250 |
$this->assertEquals(CONTEXT_MODULE, $event->contextlevel);
|
| 251 |
$this->assertEquals($glossary->cmid, $event->contextinstanceid);
|
251 |
$this->assertEquals($glossary->cmid, $event->contextinstanceid);
|
| 252 |
$this->assertEventContextNotUsed($event);
|
252 |
$this->assertEventContextNotUsed($event);
|
| 253 |
}
|
253 |
}
|
| Línea 254... |
Línea 254... |
| 254 |
|
254 |
|
| 255 |
public function test_entry_deleted() {
|
255 |
public function test_entry_deleted(): void {
|
| 256 |
global $DB;
|
256 |
global $DB;
|
| 257 |
// There is no proper API to call to trigger this event, so what we are
|
257 |
// There is no proper API to call to trigger this event, so what we are
|
| Línea 258... |
Línea 258... |
| 258 |
// doing here is simply making sure that the events returns the right information.
|
258 |
// doing here is simply making sure that the events returns the right information.
|
| Línea 292... |
Línea 292... |
| 292 |
$this->assertEquals(CONTEXT_MODULE, $event->contextlevel);
|
292 |
$this->assertEquals(CONTEXT_MODULE, $event->contextlevel);
|
| 293 |
$this->assertEquals($glossary->cmid, $event->contextinstanceid);
|
293 |
$this->assertEquals($glossary->cmid, $event->contextinstanceid);
|
| 294 |
$this->assertEventContextNotUsed($event);
|
294 |
$this->assertEventContextNotUsed($event);
|
| 295 |
}
|
295 |
}
|
| Línea 296... |
Línea 296... |
| 296 |
|
296 |
|
| 297 |
public function test_category_created() {
|
297 |
public function test_category_created(): void {
|
| 298 |
global $DB;
|
298 |
global $DB;
|
| 299 |
// There is no proper API to call to trigger this event, so what we are
|
299 |
// There is no proper API to call to trigger this event, so what we are
|
| Línea 300... |
Línea 300... |
| 300 |
// doing here is simply making sure that the events returns the right information.
|
300 |
// doing here is simply making sure that the events returns the right information.
|
| Línea 370... |
Línea 370... |
| 370 |
$this->assertEquals(CONTEXT_MODULE, $event->contextlevel);
|
370 |
$this->assertEquals(CONTEXT_MODULE, $event->contextlevel);
|
| 371 |
$this->assertEquals($glossary->cmid, $event->contextinstanceid);
|
371 |
$this->assertEquals($glossary->cmid, $event->contextinstanceid);
|
| 372 |
$this->assertEventContextNotUsed($event);
|
372 |
$this->assertEventContextNotUsed($event);
|
| 373 |
}
|
373 |
}
|
| Línea 374... |
Línea 374... |
| 374 |
|
374 |
|
| 375 |
public function test_entry_approved() {
|
375 |
public function test_entry_approved(): void {
|
| 376 |
global $DB;
|
376 |
global $DB;
|
| 377 |
// There is no proper API to call to trigger this event, so what we are
|
377 |
// There is no proper API to call to trigger this event, so what we are
|
| Línea 378... |
Línea 378... |
| 378 |
// doing here is simply making sure that the events returns the right information.
|
378 |
// doing here is simply making sure that the events returns the right information.
|
| Línea 446... |
Línea 446... |
| 446 |
$this->assertEquals(CONTEXT_MODULE, $event->contextlevel);
|
446 |
$this->assertEquals(CONTEXT_MODULE, $event->contextlevel);
|
| 447 |
$this->assertEquals($glossary->cmid, $event->contextinstanceid);
|
447 |
$this->assertEquals($glossary->cmid, $event->contextinstanceid);
|
| 448 |
$this->assertEventContextNotUsed($event);
|
448 |
$this->assertEventContextNotUsed($event);
|
| 449 |
}
|
449 |
}
|
| Línea 450... |
Línea 450... |
| 450 |
|
450 |
|
| 451 |
public function test_entry_viewed() {
|
451 |
public function test_entry_viewed(): void {
|
| 452 |
// There is no proper API to call to trigger this event, so what we are
|
452 |
// There is no proper API to call to trigger this event, so what we are
|
| Línea 453... |
Línea 453... |
| 453 |
// doing here is simply making sure that the events returns the right information.
|
453 |
// doing here is simply making sure that the events returns the right information.
|
| 454 |
|
454 |
|