Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 144... Línea 144...
144
    }
144
    }
Línea 145... Línea 145...
145
 
145
 
146
    /**
146
    /**
147
     * Test fetching contexts for a given user ID.
147
     * Test fetching contexts for a given user ID.
148
     */
148
     */
149
    public function test_get_contexts_for_userid() {
149
    public function test_get_contexts_for_userid(): void {
150
        // Ensure both contexts are found for both users.
150
        // Ensure both contexts are found for both users.
151
        $expected = [$this->c1context->id, $this->c2context->id];
151
        $expected = [$this->c1context->id, $this->c2context->id];
Línea 152... Línea 152...
152
        sort($expected);
152
        sort($expected);
Línea 169... Línea 169...
169
    }
169
    }
Línea 170... Línea 170...
170
 
170
 
171
    /**
171
    /**
172
     * Test fetching user IDs for a given context.
172
     * Test fetching user IDs for a given context.
173
     */
173
     */
174
    public function test_get_users_in_context() {
174
    public function test_get_users_in_context(): void {
Línea 175... Línea 175...
175
        $component = 'search_simpledb';
175
        $component = 'search_simpledb';
176
 
176
 
177
        // Ensure both users are found for both contexts.
177
        // Ensure both users are found for both contexts.
Línea 200... Línea 200...
200
    /**
200
    /**
201
     * Test export user data.
201
     * Test export user data.
202
     *
202
     *
203
     * @return null
203
     * @return null
204
     */
204
     */
205
    public function test_export_user_data() {
205
    public function test_export_user_data(): void {
206
        global $DB;
206
        global $DB;
Línea 207... Línea 207...
207
 
207
 
208
        $contextlist = new \core_privacy\local\request\approved_contextlist($this->u1, 'search_simpledb',
208
        $contextlist = new \core_privacy\local\request\approved_contextlist($this->u1, 'search_simpledb',
209
                                                                            [$this->c1context->id]);
209
                                                                            [$this->c1context->id]);
Línea 223... Línea 223...
223
    /**
223
    /**
224
     * Test delete search for context.
224
     * Test delete search for context.
225
     *
225
     *
226
     * @return null
226
     * @return null
227
     */
227
     */
228
    public function test_delete_data_for_all_users() {
228
    public function test_delete_data_for_all_users(): void {
229
        global $DB;
229
        global $DB;
Línea 230... Línea 230...
230
 
230
 
Línea 231... Línea 231...
231
        $this->assertEquals(8, $DB->count_records('search_simpledb_index'));
231
        $this->assertEquals(8, $DB->count_records('search_simpledb_index'));
Línea 243... Línea 243...
243
    /**
243
    /**
244
     * Test delete search for user.
244
     * Test delete search for user.
245
     *
245
     *
246
     * @return null
246
     * @return null
247
     */
247
     */
248
    public function test_delete_data_for_user() {
248
    public function test_delete_data_for_user(): void {
249
        global $DB;
249
        global $DB;
Línea 250... Línea 250...
250
 
250
 
251
        $contextlist = new \core_privacy\local\request\approved_contextlist($this->u1, 'search_simpledb',
251
        $contextlist = new \core_privacy\local\request\approved_contextlist($this->u1, 'search_simpledb',
252
                                                                            [$this->c1context->id]);
252
                                                                            [$this->c1context->id]);
Línea 268... Línea 268...
268
    }
268
    }
Línea 269... Línea 269...
269
 
269
 
270
    /**
270
    /**
271
     * Test deleting data for an approved userlist.
271
     * Test deleting data for an approved userlist.
272
     */
272
     */
273
    public function test_delete_data_for_users() {
273
    public function test_delete_data_for_users(): void {
274
        global $DB;
274
        global $DB;
275
        $component = 'search_simpledb';
275
        $component = 'search_simpledb';
Línea 276... Línea 276...
276
        $select = 'contextid = :contextid AND (owneruserid = :owneruserid OR userid = :userid)';
276
        $select = 'contextid = :contextid AND (owneruserid = :owneruserid OR userid = :userid)';