Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 157... Línea 157...
157
    }
157
    }
Línea 158... Línea 158...
158
 
158
 
159
    /**
159
    /**
160
     * Test fetching users within a context.
160
     * Test fetching users within a context.
161
     */
161
     */
162
    public function test_get_users_in_context() {
162
    public function test_get_users_in_context(): void {
Línea 163... Línea 163...
163
        global $CFG;
163
        global $CFG;
164
 
164
 
165
        $component = 'core_analytics';
165
        $component = 'core_analytics';
Línea 196... Línea 196...
196
    /**
196
    /**
197
     * Test delete a context.
197
     * Test delete a context.
198
     *
198
     *
199
     * @return null
199
     * @return null
200
     */
200
     */
201
    public function test_delete_context_data() {
201
    public function test_delete_context_data(): void {
202
        global $DB;
202
        global $DB;
Línea 203... Línea 203...
203
 
203
 
204
        // We have 4 predictions for model1 and 8 predictions for model2.
204
        // We have 4 predictions for model1 and 8 predictions for model2.
205
        $this->assertEquals(12, $DB->count_records('analytics_predictions'));
205
        $this->assertEquals(12, $DB->count_records('analytics_predictions'));
Línea 226... Línea 226...
226
    /**
226
    /**
227
     * Test delete a user.
227
     * Test delete a user.
228
     *
228
     *
229
     * @return null
229
     * @return null
230
     */
230
     */
231
    public function test_delete_user_data() {
231
    public function test_delete_user_data(): void {
232
        global $DB;
232
        global $DB;
Línea 233... Línea 233...
233
 
233
 
234
        $usercontexts = provider::get_contexts_for_userid($this->u3->id);
234
        $usercontexts = provider::get_contexts_for_userid($this->u3->id);
235
        $contextlist = new \core_privacy\local\request\approved_contextlist($this->u3, 'core_analytics',
235
        $contextlist = new \core_privacy\local\request\approved_contextlist($this->u3, 'core_analytics',
Línea 255... Línea 255...
255
    }
255
    }
Línea 256... Línea 256...
256
 
256
 
257
    /**
257
    /**
258
     * Test deleting multiple users in a context.
258
     * Test deleting multiple users in a context.
259
     */
259
     */
260
    public function test_delete_data_for_users() {
260
    public function test_delete_data_for_users(): void {
Línea 261... Línea 261...
261
        global $DB;
261
        global $DB;
262
 
262
 
263
        $component = 'core_analytics';
263
        $component = 'core_analytics';
Línea 410... Línea 410...
410
    /**
410
    /**
411
     * Test export user data.
411
     * Test export user data.
412
     *
412
     *
413
     * @return null
413
     * @return null
414
     */
414
     */
415
    public function test_export_data() {
415
    public function test_export_data(): void {
416
        global $DB;
416
        global $DB;
Línea 417... Línea 417...
417
 
417
 
418
        $system = \context_system::instance();
418
        $system = \context_system::instance();
419
        list($total, $predictions) = $this->model1->get_predictions($system);
419
        list($total, $predictions) = $this->model1->get_predictions($system);