Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 159... Línea 159...
159
    }
159
    }
Línea 160... Línea 160...
160
 
160
 
161
    /**
161
    /**
162
     * Test for provider::get_metadata().
162
     * Test for provider::get_metadata().
163
     */
163
     */
164
    public function test_get_metadata() {
164
    public function test_get_metadata(): void {
165
        $collection = new collection('mod_data');
165
        $collection = new collection('mod_data');
166
        $newcollection = provider::get_metadata($collection);
166
        $newcollection = provider::get_metadata($collection);
167
        $itemcollection = $newcollection->get_collection();
167
        $itemcollection = $newcollection->get_collection();
Línea 175... Línea 175...
175
    }
175
    }
Línea 176... Línea 176...
176
 
176
 
177
    /**
177
    /**
178
     * Test for provider::get_contexts_for_userid().
178
     * Test for provider::get_contexts_for_userid().
179
     */
179
     */
180
    public function test_get_contexts_for_userid() {
180
    public function test_get_contexts_for_userid(): void {
Línea 181... Línea 181...
181
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
181
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
182
 
182
 
183
        $contextlist = provider::get_contexts_for_userid($this->student->id);
183
        $contextlist = provider::get_contexts_for_userid($this->student->id);
Línea 188... Línea 188...
188
    }
188
    }
Línea 189... Línea 189...
189
 
189
 
190
    /**
190
    /**
191
     * Test for provider::get_users_in_context().
191
     * Test for provider::get_users_in_context().
192
     */
192
     */
193
    public function test_get_users_in_context() {
193
    public function test_get_users_in_context(): void {
194
        $component = 'mod_data';
194
        $component = 'mod_data';
195
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
195
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
Línea 196... Línea 196...
196
        $cmcontext = \context_module::instance($cm->id);
196
        $cmcontext = \context_module::instance($cm->id);
Línea 219... Línea 219...
219
    }
219
    }
Línea 220... Línea 220...
220
 
220
 
221
    /**
221
    /**
222
     * Test for provider::export_user_data().
222
     * Test for provider::export_user_data().
223
     */
223
     */
224
    public function test_export_for_context() {
224
    public function test_export_for_context(): void {
225
        global $DB;
225
        global $DB;
226
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
226
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
227
        $cmcontext = \context_module::instance($cm->id);
227
        $cmcontext = \context_module::instance($cm->id);
228
        $records = $DB->get_records_select('data_records', 'userid = :userid ORDER BY id', ['userid' => $this->student->id]);
228
        $records = $DB->get_records_select('data_records', 'userid = :userid ORDER BY id', ['userid' => $this->student->id]);
Línea 245... Línea 245...
245
    }
245
    }
Línea 246... Línea 246...
246
 
246
 
247
    /**
247
    /**
248
     * Test for provider::delete_data_for_all_users_in_context().
248
     * Test for provider::delete_data_for_all_users_in_context().
249
     */
249
     */
250
    public function test_delete_data_for_all_users_in_context() {
250
    public function test_delete_data_for_all_users_in_context(): void {
251
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
251
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
Línea 252... Línea 252...
252
        $cmcontext = \context_module::instance($cm->id);
252
        $cmcontext = \context_module::instance($cm->id);
Línea 259... Línea 259...
259
    }
259
    }
Línea 260... Línea 260...
260
 
260
 
261
    /**
261
    /**
262
     * Test for provider::delete_data_for_user().
262
     * Test for provider::delete_data_for_user().
263
     */
263
     */
264
    public function test_delete_data_for_user() {
264
    public function test_delete_data_for_user(): void {
265
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
265
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
Línea 266... Línea 266...
266
        $cmcontext = \context_module::instance($cm->id);
266
        $cmcontext = \context_module::instance($cm->id);
267
 
267
 
Línea 273... Línea 273...
273
    }
273
    }
Línea 274... Línea 274...
274
 
274
 
275
    /**
275
    /**
276
     * Test for provider::delete_data_for_users().
276
     * Test for provider::delete_data_for_users().
277
     */
277
     */
278
    public function test_delete_data_for_users() {
278
    public function test_delete_data_for_users(): void {
279
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
279
        $cm = get_coursemodule_from_instance('data', $this->datamodule->id);
280
        $cmcontext = \context_module::instance($cm->id);
280
        $cmcontext = \context_module::instance($cm->id);
Línea 281... Línea 281...
281
        $userstodelete = [$this->student->id, $this->student2->id];
281
        $userstodelete = [$this->student->id, $this->student2->id];