Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 57... Línea 57...
57
    }
57
    }
Línea 58... Línea 58...
58
 
58
 
59
    /**
59
    /**
60
     * Tests for event note_deleted.
60
     * Tests for event note_deleted.
61
     */
61
     */
62
    public function test_note_deleted_event() {
62
    public function test_note_deleted_event(): void {
63
        // Delete a note.
63
        // Delete a note.
64
        $sink = $this->redirectEvents();
64
        $sink = $this->redirectEvents();
65
        note_delete($this->eventnote);
65
        note_delete($this->eventnote);
66
        $events = $sink->get_events();
66
        $events = $sink->get_events();
Línea 85... Línea 85...
85
    }
85
    }
Línea 86... Línea 86...
86
 
86
 
87
    /**
87
    /**
88
     * Tests for event note_created.
88
     * Tests for event note_created.
89
     */
89
     */
Línea 90... Línea 90...
90
    public function test_note_created_event() {
90
    public function test_note_created_event(): void {
91
 
91
 
92
        // Delete a note.
92
        // Delete a note.
93
        $sink = $this->redirectEvents();
93
        $sink = $this->redirectEvents();
Línea 109... Línea 109...
109
    }
109
    }
Línea 110... Línea 110...
110
 
110
 
111
    /**
111
    /**
112
     * Tests for event note_updated.
112
     * Tests for event note_updated.
113
     */
113
     */
Línea 114... Línea 114...
114
    public function test_note_updated_event() {
114
    public function test_note_updated_event(): void {
115
 
115
 
116
        // Delete a note.
116
        // Delete a note.
117
        $sink = $this->redirectEvents();
117
        $sink = $this->redirectEvents();
Línea 136... Línea 136...
136
     * Test the notes viewed event.
136
     * Test the notes viewed event.
137
     *
137
     *
138
     * It's not possible to use the moodle API to simulate the viewing of notes, so here we
138
     * It's not possible to use the moodle API to simulate the viewing of notes, so here we
139
     * simply create the event and trigger it.
139
     * simply create the event and trigger it.
140
     */
140
     */
141
    public function test_notes_viewed() {
141
    public function test_notes_viewed(): void {
142
        $coursecontext = \context_course::instance($this->eventnote->courseid);
142
        $coursecontext = \context_course::instance($this->eventnote->courseid);
143
        // Trigger event for notes viewed.
143
        // Trigger event for notes viewed.
144
        $event = \core\event\notes_viewed::create(array(
144
        $event = \core\event\notes_viewed::create(array(
145
            'context' => $coursecontext,
145
            'context' => $coursecontext,
146
            'relateduserid' => $this->eventnote->userid
146
            'relateduserid' => $this->eventnote->userid