Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 97... Línea 97...
97
    }
97
    }
Línea 98... Línea 98...
98
 
98
 
99
    /**
99
    /**
100
     * Test for provider::get_metadata().
100
     * Test for provider::get_metadata().
101
     */
101
     */
102
    public function test_get_metadata() {
102
    public function test_get_metadata(): void {
103
        $collection = new collection('qbank_comment');
103
        $collection = new collection('qbank_comment');
104
        $newcollection = provider::get_metadata($collection);
104
        $newcollection = provider::get_metadata($collection);
105
        $itemcollection = $newcollection->get_collection();
105
        $itemcollection = $newcollection->get_collection();
Línea 113... Línea 113...
113
    }
113
    }
Línea 114... Línea 114...
114
 
114
 
115
    /**
115
    /**
116
     * Test for provider::get_contexts_for_userid() when user had not posted any comments..
116
     * Test for provider::get_contexts_for_userid() when user had not posted any comments..
117
     */
117
     */
118
    public function test_get_contexts_for_userid_no_comment() {
118
    public function test_get_contexts_for_userid_no_comment(): void {
119
        $this->setUser($this->teacher1);
119
        $this->setUser($this->teacher1);
120
        $coursecontext1 = context_course::instance($this->course1->id);
120
        $coursecontext1 = context_course::instance($this->course1->id);
Línea 121... Línea 121...
121
        $this->add_comment('New comment', $coursecontext1);
121
        $this->add_comment('New comment', $coursecontext1);
Línea 126... Línea 126...
126
    }
126
    }
Línea 127... Línea 127...
127
 
127
 
128
    /**
128
    /**
129
     * Test for provider::get_contexts_for_userid().
129
     * Test for provider::get_contexts_for_userid().
130
     */
130
     */
131
    public function test_get_contexts_for_userid() {
131
    public function test_get_contexts_for_userid(): void {
132
        $coursecontext1 = context_course::instance($this->course1->id);
132
        $coursecontext1 = context_course::instance($this->course1->id);
Línea 133... Línea 133...
133
        $coursecontext2 = context_course::instance($this->course2->id);
133
        $coursecontext2 = context_course::instance($this->course2->id);
134
 
134
 
Línea 145... Línea 145...
145
    }
145
    }
Línea 146... Línea 146...
146
 
146
 
147
    /**
147
    /**
148
     * Test for provider::export_user_data() when the user has not posted any comments.
148
     * Test for provider::export_user_data() when the user has not posted any comments.
149
     */
149
     */
150
    public function test_export_for_context_no_comment() {
150
    public function test_export_for_context_no_comment(): void {
151
        $coursecontext1 = context_course::instance($this->course1->id);
151
        $coursecontext1 = context_course::instance($this->course1->id);
Línea 152... Línea 152...
152
        $coursecontext2 = context_course::instance($this->course2->id);
152
        $coursecontext2 = context_course::instance($this->course2->id);
153
 
153
 
Línea 163... Línea 163...
163
    }
163
    }
Línea 164... Línea 164...
164
 
164
 
165
    /**
165
    /**
166
     * Test for provider::export_user_data().
166
     * Test for provider::export_user_data().
167
     */
167
     */
168
    public function test_export_for_context() {
168
    public function test_export_for_context(): void {
169
        $coursecontext1 = context_course::instance($this->course1->id);
169
        $coursecontext1 = context_course::instance($this->course1->id);
Línea 170... Línea 170...
170
        $coursecontext2 = context_course::instance($this->course2->id);
170
        $coursecontext2 = context_course::instance($this->course2->id);
171
 
171
 
Línea 181... Línea 181...
181
    }
181
    }
Línea 182... Línea 182...
182
 
182
 
183
    /**
183
    /**
184
     * Test for provider::delete_data_for_all_users_in_context().
184
     * Test for provider::delete_data_for_all_users_in_context().
185
     */
185
     */
186
    public function test_delete_data_for_all_users_in_context() {
186
    public function test_delete_data_for_all_users_in_context(): void {
Línea 187... Línea 187...
187
        global $DB;
187
        global $DB;
188
 
188
 
Línea 225... Línea 225...
225
    }
225
    }
Línea 226... Línea 226...
226
 
226
 
227
    /**
227
    /**
228
     * Test for provider::delete_data_for_user().
228
     * Test for provider::delete_data_for_user().
229
     */
229
     */
230
    public function test_delete_data_for_user() {
230
    public function test_delete_data_for_user(): void {
Línea 231... Línea 231...
231
        global $DB;
231
        global $DB;
232
 
232
 
Línea 279... Línea 279...
279
    }
279
    }
Línea 280... Línea 280...
280
 
280
 
281
    /**
281
    /**
282
     * Test that only users within a course context are fetched.
282
     * Test that only users within a course context are fetched.
283
     */
283
     */
284
    public function test_get_users_in_context() {
284
    public function test_get_users_in_context(): void {
Línea 285... Línea 285...
285
        $component = 'qbank_comment';
285
        $component = 'qbank_comment';
286
 
286
 
Línea 316... Línea 316...
316
    }
316
    }
Línea 317... Línea 317...
317
 
317
 
318
    /**
318
    /**
319
     * Test that data for users in approved userlist is deleted.
319
     * Test that data for users in approved userlist is deleted.
320
     */
320
     */
321
    public function test_delete_data_for_users() {
321
    public function test_delete_data_for_users(): void {
Línea 322... Línea 322...
322
        $component = 'qbank_comment';
322
        $component = 'qbank_comment';
323
 
323