Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 49... Línea 49...
49
    }
49
    }
Línea 50... Línea 50...
50
 
50
 
51
    /**
51
    /**
52
     * Check that a user context is returned if there is any user data for this user.
52
     * Check that a user context is returned if there is any user data for this user.
53
     */
53
     */
54
    public function test_get_contexts_for_userid() {
54
    public function test_get_contexts_for_userid(): void {
55
        $user = $this->getDataGenerator()->create_user();
55
        $user = $this->getDataGenerator()->create_user();
Línea 56... Línea 56...
56
        $this->assertEmpty(provider::get_contexts_for_userid($user->id));
56
        $this->assertEmpty(provider::get_contexts_for_userid($user->id));
57
 
57
 
Línea 71... Línea 71...
71
    }
71
    }
Línea 72... Línea 72...
72
 
72
 
73
    /**
73
    /**
74
     * Test that user data is exported correctly.
74
     * Test that user data is exported correctly.
75
     */
75
     */
76
    public function test_export_user_data() {
76
    public function test_export_user_data(): void {
77
        $user = $this->getDataGenerator()->create_user();
77
        $user = $this->getDataGenerator()->create_user();
78
        $issuer = \core\oauth2\api::create_standard_issuer('google');
78
        $issuer = \core\oauth2\api::create_standard_issuer('google');
79
        $info = [];
79
        $info = [];
80
        $info['username'] = 'gina';
80
        $info['username'] = 'gina';
Línea 92... Línea 92...
92
    }
92
    }
Línea 93... Línea 93...
93
 
93
 
94
    /**
94
    /**
95
     * Test deleting all user data for a specific context.
95
     * Test deleting all user data for a specific context.
96
     */
96
     */
97
    public function test_delete_data_for_all_users_in_context() {
97
    public function test_delete_data_for_all_users_in_context(): void {
Línea 98... Línea 98...
98
        global $DB;
98
        global $DB;
99
 
99
 
100
        $user1 = $this->getDataGenerator()->create_user();
100
        $user1 = $this->getDataGenerator()->create_user();
Línea 132... Línea 132...
132
    }
132
    }
Línea 133... Línea 133...
133
 
133
 
134
    /**
134
    /**
135
     * This should work identical to the above test.
135
     * This should work identical to the above test.
136
     */
136
     */
137
    public function test_delete_data_for_user() {
137
    public function test_delete_data_for_user(): void {
Línea 138... Línea 138...
138
        global $DB;
138
        global $DB;
139
 
139
 
140
        $user1 = $this->getDataGenerator()->create_user();
140
        $user1 = $this->getDataGenerator()->create_user();
Línea 173... Línea 173...
173
    }
173
    }
Línea 174... Línea 174...
174
 
174
 
175
    /**
175
    /**
176
     * Test that only users with a user context are fetched.
176
     * Test that only users with a user context are fetched.
177
     */
177
     */
178
    public function test_get_users_in_context() {
178
    public function test_get_users_in_context(): void {
Línea 179... Línea 179...
179
        $this->resetAfterTest();
179
        $this->resetAfterTest();
180
 
180
 
181
        $component = 'auth_oauth2';
181
        $component = 'auth_oauth2';
Línea 209... Línea 209...
209
    }
209
    }
Línea 210... Línea 210...
210
 
210
 
211
    /**
211
    /**
212
     * Test that data for users in approved userlist is deleted.
212
     * Test that data for users in approved userlist is deleted.
213
     */
213
     */
214
    public function test_delete_data_for_users() {
214
    public function test_delete_data_for_users(): void {
Línea 215... Línea 215...
215
        $this->resetAfterTest();
215
        $this->resetAfterTest();
216
 
216
 
217
        $component = 'auth_oauth2';
217
        $component = 'auth_oauth2';