Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 42... Línea 42...
42
class provider_test extends provider_testcase {
42
class provider_test extends provider_testcase {
Línea 43... Línea 43...
43
 
43
 
44
    /**
44
    /**
45
     * Check that context information is returned correctly.
45
     * Check that context information is returned correctly.
46
     */
46
     */
47
    public function test_get_contexts_for_userid() {
47
    public function test_get_contexts_for_userid(): void {
48
        $this->resetAfterTest();
48
        $this->resetAfterTest();
49
        $user = $this->getDataGenerator()->create_user();
49
        $user = $this->getDataGenerator()->create_user();
50
        // Create some other users as well.
50
        // Create some other users as well.
51
        $user2 = $this->getDataGenerator()->create_user();
51
        $user2 = $this->getDataGenerator()->create_user();
Línea 57... Línea 57...
57
    }
57
    }
Línea 58... Línea 58...
58
 
58
 
59
    /**
59
    /**
60
     * Test that data is exported as expected for a user.
60
     * Test that data is exported as expected for a user.
61
     */
61
     */
62
    public function test_export_user_data() {
62
    public function test_export_user_data(): void {
63
        $this->resetAfterTest();
63
        $this->resetAfterTest();
64
        $user = $this->getDataGenerator()->create_user([
64
        $user = $this->getDataGenerator()->create_user([
65
            'firstaccess' => 1535760000,
65
            'firstaccess' => 1535760000,
66
            'lastaccess' => 1541030400,
66
            'lastaccess' => 1541030400,
Línea 139... Línea 139...
139
    }
139
    }
Línea 140... Línea 140...
140
 
140
 
141
    /**
141
    /**
142
     * Test that user data is deleted for one user.
142
     * Test that user data is deleted for one user.
143
     */
143
     */
144
    public function test_delete_data_for_all_users_in_context() {
144
    public function test_delete_data_for_all_users_in_context(): void {
145
        global $DB;
145
        global $DB;
146
        $this->resetAfterTest();
146
        $this->resetAfterTest();
147
        $user = $this->getDataGenerator()->create_user([
147
        $user = $this->getDataGenerator()->create_user([
148
            'idnumber' => 'A0023',
148
            'idnumber' => 'A0023',
Línea 208... Línea 208...
208
    }
208
    }
Línea 209... Línea 209...
209
 
209
 
210
    /**
210
    /**
211
     * Test that user data is deleted for one user.
211
     * Test that user data is deleted for one user.
212
     */
212
     */
213
    public function test_delete_data_for_user() {
213
    public function test_delete_data_for_user(): void {
214
        global $DB;
214
        global $DB;
215
        $this->resetAfterTest();
215
        $this->resetAfterTest();
216
        $user = $this->getDataGenerator()->create_user([
216
        $user = $this->getDataGenerator()->create_user([
217
            'idnumber' => 'A0023',
217
            'idnumber' => 'A0023',
Línea 284... Línea 284...
284
    }
284
    }
Línea 285... Línea 285...
285
 
285
 
286
    /**
286
    /**
287
     * Test that only users with a user context are fetched.
287
     * Test that only users with a user context are fetched.
288
     */
288
     */
289
    public function test_get_users_in_context() {
289
    public function test_get_users_in_context(): void {
Línea 290... Línea 290...
290
        $this->resetAfterTest();
290
        $this->resetAfterTest();
291
 
291
 
292
        $component = 'core_user';
292
        $component = 'core_user';
Línea 310... Línea 310...
310
    }
310
    }
Línea 311... Línea 311...
311
 
311
 
312
    /**
312
    /**
313
     * Test that data for users in approved userlist is deleted.
313
     * Test that data for users in approved userlist is deleted.
314
     */
314
     */
315
    public function test_delete_data_for_users() {
315
    public function test_delete_data_for_users(): void {
Línea 316... Línea 316...
316
        global $DB;
316
        global $DB;
Línea 317... Línea 317...
317
 
317