Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 61... Línea 61...
61
    protected $instancecontext2;
61
    protected $instancecontext2;
Línea 62... Línea 62...
62
 
62
 
63
    /**
63
    /**
64
     * Test getting the context for the user ID related to this plugin.
64
     * Test getting the context for the user ID related to this plugin.
65
     */
65
     */
66
    public function test_get_contexts_for_userid() {
66
    public function test_get_contexts_for_userid(): void {
Línea 67... Línea 67...
67
        global $DB;
67
        global $DB;
68
 
68
 
69
        $this->resetAfterTest();
69
        $this->resetAfterTest();
Línea 88... Línea 88...
88
    }
88
    }
Línea 89... Línea 89...
89
 
89
 
90
    /**
90
    /**
91
     * Test retrieval of user ids in a given context.
91
     * Test retrieval of user ids in a given context.
92
     */
92
     */
93
    public function test_get_users_in_context() {
93
    public function test_get_users_in_context(): void {
94
        $this->resetAfterTest();
94
        $this->resetAfterTest();
95
        $this->grading_setup_test_scenario_data();
95
        $this->grading_setup_test_scenario_data();
96
        // Instance two has one user who created the definitions and another who modified it.
96
        // Instance two has one user who created the definitions and another who modified it.
97
        $userlist = new \core_privacy\local\request\userlist($this->instancecontext2, 'core_grading');
97
        $userlist = new \core_privacy\local\request\userlist($this->instancecontext2, 'core_grading');
Línea 101... Línea 101...
101
    }
101
    }
Línea 102... Línea 102...
102
 
102
 
103
    /**
103
    /**
104
     * Export for a user with no grading definitions created or modified will not have any data exported.
104
     * Export for a user with no grading definitions created or modified will not have any data exported.
105
     */
105
     */
106
    public function test_export_user_data_no_content() {
106
    public function test_export_user_data_no_content(): void {
Línea 107... Línea 107...
107
        $this->resetAfterTest();
107
        $this->resetAfterTest();
108
 
108
 
109
        $user = $this->getDataGenerator()->create_user();
109
        $user = $this->getDataGenerator()->create_user();
Línea 118... Línea 118...
118
    }
118
    }
Línea 119... Línea 119...
119
 
119
 
120
    /**
120
    /**
121
     * Test that data is exported correctly for this plugin.
121
     * Test that data is exported correctly for this plugin.
122
     */
122
     */
123
    public function test_export_user_data() {
123
    public function test_export_user_data(): void {
Línea 124... Línea 124...
124
        global $DB;
124
        global $DB;
125
 
125
 
126
        $this->resetAfterTest();
126
        $this->resetAfterTest();
Línea 197... Línea 197...
197
    }
197
    }
Línea 198... Línea 198...
198
 
198
 
199
    /**
199
    /**
200
     * Test for provider::delete_data_for_all_users_in_context().
200
     * Test for provider::delete_data_for_all_users_in_context().
201
     */
201
     */
202
    public function test_delete_data_for_all_users_in_context() {
202
    public function test_delete_data_for_all_users_in_context(): void {
Línea 203... Línea 203...
203
        global $DB;
203
        global $DB;
204
 
204
 
Línea 218... Línea 218...
218
    }
218
    }
Línea 219... Línea 219...
219
 
219
 
220
    /**
220
    /**
221
     * Test for provider::delete_data_for_user().
221
     * Test for provider::delete_data_for_user().
222
     */
222
     */
223
    public function test_delete_data_for_user() {
223
    public function test_delete_data_for_user(): void {
Línea 224... Línea 224...
224
        global $DB;
224
        global $DB;
225
 
225
 
Línea 261... Línea 261...
261
    }
261
    }
Línea 262... Línea 262...
262
 
262
 
263
    /**
263
    /**
264
     * Test exporting user data relating to an item ID.
264
     * Test exporting user data relating to an item ID.
265
     */
265
     */
266
    public function test_export_item_data() {
266
    public function test_export_item_data(): void {
267
        global $DB;
267
        global $DB;
268
        $this->resetAfterTest();
268
        $this->resetAfterTest();
269
        $course = $this->getDataGenerator()->create_course();
269
        $course = $this->getDataGenerator()->create_course();
270
        $module = $this->getDataGenerator()->create_module('assign', ['course' => $course]);
270
        $module = $this->getDataGenerator()->create_module('assign', ['course' => $course]);
Línea 299... Línea 299...
299
    }
299
    }
Línea 300... Línea 300...
300
 
300
 
301
    /**
301
    /**
302
     * Test deleting user data related to a context and item ID.
302
     * Test deleting user data related to a context and item ID.
303
     */
303
     */
304
    public function test_delete_instance_data() {
304
    public function test_delete_instance_data(): void {
305
        global $DB;
305
        global $DB;
306
        $this->resetAfterTest();
306
        $this->resetAfterTest();
307
        $course = $this->getDataGenerator()->create_course();
307
        $course = $this->getDataGenerator()->create_course();
308
        $module = $this->getDataGenerator()->create_module('assign', ['course' => $course]);
308
        $module = $this->getDataGenerator()->create_module('assign', ['course' => $course]);
Línea 352... Línea 352...
352
    }
352
    }
Línea 353... Línea 353...
353
 
353
 
354
    /**
354
    /**
355
     * Test the deletion of multiple instances at once.
355
     * Test the deletion of multiple instances at once.
356
     */
356
     */
357
    public function test_delete_data_for_instances() {
357
    public function test_delete_data_for_instances(): void {
358
        global $DB;
358
        global $DB;
359
        $this->resetAfterTest();
359
        $this->resetAfterTest();
360
        $course = $this->getDataGenerator()->create_course();
360
        $course = $this->getDataGenerator()->create_course();
361
        $module = $this->getDataGenerator()->create_module('assign', ['course' => $course]);
361
        $module = $this->getDataGenerator()->create_module('assign', ['course' => $course]);