Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 51... Línea 51...
51
    }
51
    }
Línea 52... Línea 52...
52
 
52
 
53
    /**
53
    /**
54
     * Test for provider::get_metadata().
54
     * Test for provider::get_metadata().
55
     */
55
     */
56
    public function test_get_metadata() {
56
    public function test_get_metadata(): void {
57
        $this->resetAfterTest();
57
        $this->resetAfterTest();
58
        $collection = new collection('core_message');
58
        $collection = new collection('core_message');
59
        $newcollection = provider::get_metadata($collection);
59
        $newcollection = provider::get_metadata($collection);
60
        $itemcollection = $newcollection->get_collection();
60
        $itemcollection = $newcollection->get_collection();
Línea 153... Línea 153...
153
    }
153
    }
Línea 154... Línea 154...
154
 
154
 
155
    /**
155
    /**
156
     * Test for provider::export_user_preferences().
156
     * Test for provider::export_user_preferences().
157
     */
157
     */
158
    public function test_export_user_preferences_no_pref() {
158
    public function test_export_user_preferences_no_pref(): void {
Línea 159... Línea 159...
159
        $this->resetAfterTest();
159
        $this->resetAfterTest();
160
 
160
 
Línea 167... Línea 167...
167
    }
167
    }
Línea 168... Línea 168...
168
 
168
 
169
    /**
169
    /**
170
     * Test for provider::export_user_preferences().
170
     * Test for provider::export_user_preferences().
171
     */
171
     */
172
    public function test_export_user_preferences() {
172
    public function test_export_user_preferences(): void {
Línea 173... Línea 173...
173
        global $USER;
173
        global $USER;
Línea 174... Línea 174...
174
 
174
 
Línea 217... Línea 217...
217
    }
217
    }
Línea 218... Línea 218...
218
 
218
 
219
    /**
219
    /**
220
     * Test for provider::get_contexts_for_userid() when there is no message or notification.
220
     * Test for provider::get_contexts_for_userid() when there is no message or notification.
221
     */
221
     */
222
    public function test_get_contexts_for_userid_no_data() {
222
    public function test_get_contexts_for_userid_no_data(): void {
Línea 223... Línea 223...
223
        $this->resetAfterTest();
223
        $this->resetAfterTest();
Línea 224... Línea 224...
224
 
224
 
Línea 234... Línea 234...
234
    }
234
    }
Línea 235... Línea 235...
235
 
235
 
236
    /**
236
    /**
237
     * Test for provider::get_contexts_for_userid() when there is a private message between users.
237
     * Test for provider::get_contexts_for_userid() when there is a private message between users.
238
     */
238
     */
239
    public function test_get_contexts_for_userid_with_private_messages() {
239
    public function test_get_contexts_for_userid_with_private_messages(): void {
Línea 240... Línea 240...
240
        $this->resetAfterTest();
240
        $this->resetAfterTest();
241
 
241
 
242
        $user1 = $this->getDataGenerator()->create_user();
242
        $user1 = $this->getDataGenerator()->create_user();
Línea 279... Línea 279...
279
    }
279
    }
Línea 280... Línea 280...
280
 
280
 
281
    /**
281
    /**
282
     * Test for provider::get_contexts_for_userid() when there is several messages (private and group).
282
     * Test for provider::get_contexts_for_userid() when there is several messages (private and group).
283
     */
283
     */
284
    public function test_get_contexts_for_userid_with_messages() {
284
    public function test_get_contexts_for_userid_with_messages(): void {
285
        $this->resetAfterTest();
285
        $this->resetAfterTest();
Línea 286... Línea 286...
286
        $this->setAdminUser();
286
        $this->setAdminUser();
287
 
287
 
Línea 380... Línea 380...
380
    }
380
    }
Línea 381... Línea 381...
381
 
381
 
382
    /**
382
    /**
383
     * Test for provider::get_contexts_for_userid() when there is a notification between users.
383
     * Test for provider::get_contexts_for_userid() when there is a notification between users.
384
     */
384
     */
385
    public function test_get_contexts_for_userid_with_notification() {
385
    public function test_get_contexts_for_userid_with_notification(): void {
Línea 386... Línea 386...
386
        $this->resetAfterTest();
386
        $this->resetAfterTest();
387
 
387
 
Línea 418... Línea 418...
418
    }
418
    }
Línea 419... Línea 419...
419
 
419
 
420
    /**
420
    /**
421
     * Test for provider::get_contexts_for_userid() when a users has a contact.
421
     * Test for provider::get_contexts_for_userid() when a users has a contact.
422
     */
422
     */
423
    public function test_get_contexts_for_userid_with_contact() {
423
    public function test_get_contexts_for_userid_with_contact(): void {
Línea 424... Línea 424...
424
        $this->resetAfterTest();
424
        $this->resetAfterTest();
425
 
425
 
Línea 456... Línea 456...
456
    }
456
    }
Línea 457... Línea 457...
457
 
457
 
458
    /**
458
    /**
459
     * Test for provider::get_contexts_for_userid() when a user makes a contact request.
459
     * Test for provider::get_contexts_for_userid() when a user makes a contact request.
460
     */
460
     */
461
    public function test_get_contexts_for_userid_with_contact_request() {
461
    public function test_get_contexts_for_userid_with_contact_request(): void {
Línea 462... Línea 462...
462
        $this->resetAfterTest();
462
        $this->resetAfterTest();
463
 
463
 
Línea 494... Línea 494...
494
    }
494
    }
Línea 495... Línea 495...
495
 
495
 
496
    /**
496
    /**
497
     * Test for provider::get_contexts_for_userid() when a user is blocked.
497
     * Test for provider::get_contexts_for_userid() when a user is blocked.
498
     */
498
     */
499
    public function test_get_contexts_for_userid_with_blocked_contact() {
499
    public function test_get_contexts_for_userid_with_blocked_contact(): void {
Línea 500... Línea 500...
500
        $this->resetAfterTest();
500
        $this->resetAfterTest();
501
 
501
 
Línea 532... Línea 532...
532
    }
532
    }
Línea 533... Línea 533...
533
 
533
 
534
    /**
534
    /**
535
     * Test for provider::export_user_data().
535
     * Test for provider::export_user_data().
536
     */
536
     */
537
    public function test_export_for_context_with_contacts() {
537
    public function test_export_for_context_with_contacts(): void {
Línea 538... Línea 538...
538
        $this->resetAfterTest();
538
        $this->resetAfterTest();
539
 
539
 
540
        // Create users to test with.
540
        // Create users to test with.
Línea 575... Línea 575...
575
    }
575
    }
Línea 576... Línea 576...
576
 
576
 
577
    /**
577
    /**
578
     * Test for provider::export_user_data().
578
     * Test for provider::export_user_data().
579
     */
579
     */
580
    public function test_export_for_context_with_contact_requests() {
580
    public function test_export_for_context_with_contact_requests(): void {
Línea 581... Línea 581...
581
        $this->resetAfterTest();
581
        $this->resetAfterTest();
582
 
582
 
583
        // Create users to test with.
583
        // Create users to test with.
Línea 620... Línea 620...
620
    }
620
    }
Línea 621... Línea 621...
621
 
621
 
622
    /**
622
    /**
623
     * Test for provider::export_user_data().
623
     * Test for provider::export_user_data().
624
     */
624
     */
625
    public function test_export_for_context_with_blocked_users() {
625
    public function test_export_for_context_with_blocked_users(): void {
Línea 626... Línea 626...
626
        $this->resetAfterTest();
626
        $this->resetAfterTest();
627
 
627
 
628
        // Create users to test with.
628
        // Create users to test with.
Línea 662... Línea 662...
662
    }
662
    }
Línea 663... Línea 663...
663
 
663
 
664
    /**
664
    /**
665
     * Test for provider::export_user_data().
665
     * Test for provider::export_user_data().
666
     */
666
     */
667
    public function test_export_for_context_with_private_messages() {
667
    public function test_export_for_context_with_private_messages(): void {
Línea 668... Línea 668...
668
        global $DB;
668
        global $DB;
Línea 669... Línea 669...
669
 
669
 
Línea 770... Línea 770...
770
    }
770
    }
Línea 771... Línea 771...
771
 
771
 
772
    /**
772
    /**
773
     * Test for provider::export_user_data().
773
     * Test for provider::export_user_data().
774
     */
774
     */
775
    public function test_export_for_context_with_messages() {
775
    public function test_export_for_context_with_messages(): void {
Línea 776... Línea 776...
776
        global $DB;
776
        global $DB;
777
 
777
 
778
        $this->resetAfterTest();
778
        $this->resetAfterTest();
Línea 877... Línea 877...
877
    }
877
    }
Línea 878... Línea 878...
878
 
878
 
879
    /**
879
    /**
880
     * Test for provider::export_user_data().
880
     * Test for provider::export_user_data().
881
     */
881
     */
882
    public function test_export_for_context_with_notifications() {
882
    public function test_export_for_context_with_notifications(): void {
Línea 883... Línea 883...
883
        $this->resetAfterTest();
883
        $this->resetAfterTest();
884
 
884
 
885
        // Create users to test with.
885
        // Create users to test with.
Línea 925... Línea 925...
925
    }
925
    }
Línea 926... Línea 926...
926
 
926
 
927
    /**
927
    /**
928
     * Test for provider::delete_data_for_all_users_in_context().
928
     * Test for provider::delete_data_for_all_users_in_context().
929
     */
929
     */
930
    public function test_delete_data_for_all_users_in_context() {
930
    public function test_delete_data_for_all_users_in_context(): void {
Línea 931... Línea 931...
931
        global $DB;
931
        global $DB;
Línea 932... Línea 932...
932
 
932
 
Línea 1046... Línea 1046...
1046
    }
1046
    }
Línea 1047... Línea 1047...
1047
 
1047
 
1048
    /**
1048
    /**
1049
     * Test for provider::delete_data_for_user().
1049
     * Test for provider::delete_data_for_user().
1050
     */
1050
     */
1051
    public function test_delete_data_for_user() {
1051
    public function test_delete_data_for_user(): void {
Línea 1052... Línea 1052...
1052
        global $DB;
1052
        global $DB;
Línea 1053... Línea 1053...
1053
 
1053
 
Línea 1159... Línea 1159...
1159
    }
1159
    }
Línea 1160... Línea 1160...
1160
 
1160
 
1161
    /**
1161
    /**
1162
     * Test for provider::get_users_in_context() when there is no message or notification.
1162
     * Test for provider::get_users_in_context() when there is no message or notification.
1163
     */
1163
     */
1164
    public function test_get_users_in_context_no_data() {
1164
    public function test_get_users_in_context_no_data(): void {
Línea 1165... Línea 1165...
1165
        $this->resetAfterTest();
1165
        $this->resetAfterTest();
1166
 
1166
 
1167
        $user = $this->getDataGenerator()->create_user();
1167
        $user = $this->getDataGenerator()->create_user();
Línea 1175... Línea 1175...
1175
    }
1175
    }
Línea 1176... Línea 1176...
1176
 
1176
 
1177
    /**
1177
    /**
1178
     * Test for provider::get_users_in_context() when there is a message between users.
1178
     * Test for provider::get_users_in_context() when there is a message between users.
1179
     */
1179
     */
1180
    public function test_get_users_in_context_with_message() {
1180
    public function test_get_users_in_context_with_message(): void {
Línea 1181... Línea 1181...
1181
        $this->resetAfterTest();
1181
        $this->resetAfterTest();
1182
 
1182
 
Línea 1216... Línea 1216...
1216
    }
1216
    }
Línea 1217... Línea 1217...
1217
 
1217
 
1218
    /**
1218
    /**
1219
     * Test for provider::get_users_in_context() when there is a notification between users.
1219
     * Test for provider::get_users_in_context() when there is a notification between users.
1220
     */
1220
     */
1221
    public function test_get_users_in_context_with_notification() {
1221
    public function test_get_users_in_context_with_notification(): void {
Línea 1222... Línea 1222...
1222
        $this->resetAfterTest();
1222
        $this->resetAfterTest();
1223
 
1223
 
Línea 1257... Línea 1257...
1257
    }
1257
    }
Línea 1258... Línea 1258...
1258
 
1258
 
1259
    /**
1259
    /**
1260
     * Test for provider::get_users_in_context() when a users has a contact.
1260
     * Test for provider::get_users_in_context() when a users has a contact.
1261
     */
1261
     */
1262
    public function test_get_users_in_context_with_contact() {
1262
    public function test_get_users_in_context_with_contact(): void {
Línea 1263... Línea 1263...
1263
        $this->resetAfterTest();
1263
        $this->resetAfterTest();
1264
 
1264
 
Línea 1298... Línea 1298...
1298
    }
1298
    }
Línea 1299... Línea 1299...
1299
 
1299
 
1300
    /**
1300
    /**
1301
     * Test for provider::get_users_in_context() when a user makes a contact request.
1301
     * Test for provider::get_users_in_context() when a user makes a contact request.
1302
     */
1302
     */
1303
    public function test_get_users_in_context_with_contact_request() {
1303
    public function test_get_users_in_context_with_contact_request(): void {
Línea 1304... Línea 1304...
1304
        $this->resetAfterTest();
1304
        $this->resetAfterTest();
1305
 
1305
 
Línea 1339... Línea 1339...
1339
    }
1339
    }
Línea 1340... Línea 1340...
1340
 
1340
 
1341
    /**
1341
    /**
1342
     * Test for provider::get_users_in_context() when a user is blocked.
1342
     * Test for provider::get_users_in_context() when a user is blocked.
1343
     */
1343
     */
1344
    public function test_get_users_in_context_with_blocked_contact() {
1344
    public function test_get_users_in_context_with_blocked_contact(): void {
Línea 1345... Línea 1345...
1345
        $this->resetAfterTest();
1345
        $this->resetAfterTest();
1346
 
1346
 
Línea 1380... Línea 1380...
1380
    }
1380
    }
Línea 1381... Línea 1381...
1381
 
1381
 
1382
    /**
1382
    /**
1383
     * Test for provider::delete_data_for_users().
1383
     * Test for provider::delete_data_for_users().
1384
     */
1384
     */
1385
    public function test_delete_data_for_users() {
1385
    public function test_delete_data_for_users(): void {
Línea 1386... Línea 1386...
1386
        global $DB;
1386
        global $DB;
Línea 1387... Línea 1387...
1387
 
1387
 
Línea 1495... Línea 1495...
1495
    }
1495
    }
Línea 1496... Línea 1496...
1496
 
1496
 
1497
    /**
1497
    /**
1498
     * Test for provider::add_contexts_for_conversations().
1498
     * Test for provider::add_contexts_for_conversations().
1499
     */
1499
     */
1500
    public function test_add_contexts_for_conversations() {
1500
    public function test_add_contexts_for_conversations(): void {
1501
        $this->resetAfterTest();
1501
        $this->resetAfterTest();
1502
        $this->setAdminUser();
1502
        $this->setAdminUser();
1503
        $component = 'core_group';
1503
        $component = 'core_group';
Línea 1584... Línea 1584...
1584
    }
1584
    }
Línea 1585... Línea 1585...
1585
 
1585
 
1586
    /**
1586
    /**
1587
     * Test for provider::add_conversations_in_context().
1587
     * Test for provider::add_conversations_in_context().
1588
     */
1588
     */
1589
    public function test_add_conversations_in_context() {
1589
    public function test_add_conversations_in_context(): void {
1590
        $this->resetAfterTest();
1590
        $this->resetAfterTest();
1591
        $this->setAdminUser();
1591
        $this->setAdminUser();
1592
        $component = 'core_group';
1592
        $component = 'core_group';
Línea 1655... Línea 1655...
1655
    }
1655
    }
Línea 1656... Línea 1656...
1656
 
1656
 
1657
    /**
1657
    /**
1658
     * Test for provider::export_conversations().
1658
     * Test for provider::export_conversations().
1659
     */
1659
     */
1660
    public function test_export_conversations() {
1660
    public function test_export_conversations(): void {
Línea 1661... Línea 1661...
1661
        global $DB;
1661
        global $DB;
1662
 
1662
 
1663
        $this->resetAfterTest();
1663
        $this->resetAfterTest();
Línea 1864... Línea 1864...
1864
    }
1864
    }
Línea 1865... Línea 1865...
1865
 
1865
 
1866
    /**
1866
    /**
1867
     * Test for provider::delete_conversations_for_all_users().
1867
     * Test for provider::delete_conversations_for_all_users().
1868
     */
1868
     */
1869
    public function test_delete_conversations_for_all_users() {
1869
    public function test_delete_conversations_for_all_users(): void {
Línea 1870... Línea 1870...
1870
        global $DB;
1870
        global $DB;
1871
 
1871
 
1872
        $this->resetAfterTest();
1872
        $this->resetAfterTest();
Línea 2052... Línea 2052...
2052
    }
2052
    }
Línea 2053... Línea 2053...
2053
 
2053
 
2054
    /**
2054
    /**
2055
     * Test for provider::delete_conversations_for_all_users() in the system context.
2055
     * Test for provider::delete_conversations_for_all_users() in the system context.
2056
     */
2056
     */
2057
    public function test_delete_conversations_for_all_users_systemcontext() {
2057
    public function test_delete_conversations_for_all_users_systemcontext(): void {
Línea 2058... Línea 2058...
2058
        global $DB;
2058
        global $DB;
2059
 
2059
 
2060
        $this->resetAfterTest();
2060
        $this->resetAfterTest();
Línea 2220... Línea 2220...
2220
    }
2220
    }
Línea 2221... Línea 2221...
2221
 
2221
 
2222
    /**
2222
    /**
2223
     * Test for provider::delete_conversations_for_all_users() in the user context.
2223
     * Test for provider::delete_conversations_for_all_users() in the user context.
2224
     */
2224
     */
2225
    public function test_delete_conversations_for_all_users_usercontext() {
2225
    public function test_delete_conversations_for_all_users_usercontext(): void {
Línea 2226... Línea 2226...
2226
        global $DB;
2226
        global $DB;
2227
 
2227
 
2228
        $this->resetAfterTest();
2228
        $this->resetAfterTest();
Línea 2389... Línea 2389...
2389
    }
2389
    }
Línea 2390... Línea 2390...
2390
 
2390
 
2391
    /**
2391
    /**
2392
     * Test for provider::delete_conversations_for_user().
2392
     * Test for provider::delete_conversations_for_user().
2393
     */
2393
     */
2394
    public function test_delete_conversations_for_user() {
2394
    public function test_delete_conversations_for_user(): void {
Línea 2395... Línea 2395...
2395
        global $DB;
2395
        global $DB;
2396
 
2396
 
2397
        $this->resetAfterTest();
2397
        $this->resetAfterTest();
Línea 2587... Línea 2587...
2587
 
2587
 
2588
 
2588
 
2589
    /**
2589
    /**
2590
     * Test for provider::delete_conversations_for_users().
2590
     * Test for provider::delete_conversations_for_users().
2591
     */
2591
     */
Línea 2592... Línea 2592...
2592
    public function test_delete_conversations_for_users() {
2592
    public function test_delete_conversations_for_users(): void {
2593
        global $DB;
2593
        global $DB;
2594
 
2594