Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 156... Línea 156...
156
    /**
156
    /**
157
     * Test can_subscribe_to_forum.
157
     * Test can_subscribe_to_forum.
158
     *
158
     *
159
     * @covers ::can_subscribe_to_forum
159
     * @covers ::can_subscribe_to_forum
160
     */
160
     */
161
    public function test_can_subscribe_to_forum() {
161
    public function test_can_subscribe_to_forum(): void {
162
        $this->resetAfterTest();
162
        $this->resetAfterTest();
Línea 163... Línea 163...
163
 
163
 
164
        $forum = $this->create_forum();
164
        $forum = $this->create_forum();
165
        $guestuser = $this->getDataGenerator()->create_user();
165
        $guestuser = $this->getDataGenerator()->create_user();
Línea 172... Línea 172...
172
    /**
172
    /**
173
     * Test can_create_discussions.
173
     * Test can_create_discussions.
174
     *
174
     *
175
     * @covers ::can_create_discussions
175
     * @covers ::can_create_discussions
176
     */
176
     */
177
    public function test_can_create_discussions() {
177
    public function test_can_create_discussions(): void {
178
        $this->resetAfterTest();
178
        $this->resetAfterTest();
Línea 179... Línea 179...
179
 
179
 
180
        $forum = $this->create_forum();
180
        $forum = $this->create_forum();
181
        $guestuser = $this->getDataGenerator()->create_user();
181
        $guestuser = $this->getDataGenerator()->create_user();
Línea 253... Línea 253...
253
    /**
253
    /**
254
     * Test can_access_all_groups.
254
     * Test can_access_all_groups.
255
     *
255
     *
256
     * @covers ::can_access_all_groups
256
     * @covers ::can_access_all_groups
257
     */
257
     */
258
    public function test_can_access_all_groups() {
258
    public function test_can_access_all_groups(): void {
259
        $this->resetAfterTest();
259
        $this->resetAfterTest();
Línea 260... Línea 260...
260
 
260
 
261
        $forum = $this->create_forum();
261
        $forum = $this->create_forum();
262
        $user = $this->user;
262
        $user = $this->user;
Línea 272... Línea 272...
272
    /**
272
    /**
273
     * Test can_access_group.
273
     * Test can_access_group.
274
     *
274
     *
275
     * @covers ::can_access_group
275
     * @covers ::can_access_group
276
     */
276
     */
277
    public function test_can_access_group() {
277
    public function test_can_access_group(): void {
278
        $this->resetAfterTest();
278
        $this->resetAfterTest();
Línea 279... Línea 279...
279
 
279
 
280
        $forum = $this->create_forum();
280
        $forum = $this->create_forum();
281
        $user = $this->user;
281
        $user = $this->user;
Línea 296... Línea 296...
296
    /**
296
    /**
297
     * Test can_view_discussions.
297
     * Test can_view_discussions.
298
     *
298
     *
299
     * @covers ::can_view_discussions
299
     * @covers ::can_view_discussions
300
     */
300
     */
301
    public function test_can_view_discussions() {
301
    public function test_can_view_discussions(): void {
302
        $this->resetAfterTest();
302
        $this->resetAfterTest();
Línea 303... Línea 303...
303
 
303
 
304
        $forum = $this->create_forum();
304
        $forum = $this->create_forum();
305
        $user = $this->user;
305
        $user = $this->user;
Línea 315... Línea 315...
315
    /**
315
    /**
316
     * Test can_move_discussions.
316
     * Test can_move_discussions.
317
     *
317
     *
318
     * @covers ::can_move_discussions
318
     * @covers ::can_move_discussions
319
     */
319
     */
320
    public function test_can_move_discussions() {
320
    public function test_can_move_discussions(): void {
321
        $this->resetAfterTest();
321
        $this->resetAfterTest();
Línea 322... Línea 322...
322
 
322
 
323
        $forum = $this->create_forum();
323
        $forum = $this->create_forum();
324
        $user = $this->user;
324
        $user = $this->user;
Línea 339... Línea 339...
339
    /**
339
    /**
340
     * Test can_pin_discussions.
340
     * Test can_pin_discussions.
341
     *
341
     *
342
     * @covers ::can_pin_discussions
342
     * @covers ::can_pin_discussions
343
     */
343
     */
344
    public function test_can_pin_discussions() {
344
    public function test_can_pin_discussions(): void {
345
        $this->resetAfterTest();
345
        $this->resetAfterTest();
Línea 346... Línea 346...
346
 
346
 
347
        $forum = $this->create_forum();
347
        $forum = $this->create_forum();
348
        $user = $this->user;
348
        $user = $this->user;
Línea 358... Línea 358...
358
    /**
358
    /**
359
     * Test can_split_discussions.
359
     * Test can_split_discussions.
360
     *
360
     *
361
     * @covers ::can_split_discussions
361
     * @covers ::can_split_discussions
362
     */
362
     */
363
    public function test_can_split_discussions() {
363
    public function test_can_split_discussions(): void {
364
        $this->resetAfterTest();
364
        $this->resetAfterTest();
Línea 365... Línea 365...
365
 
365
 
366
        $forum = $this->create_forum();
366
        $forum = $this->create_forum();
367
        $user = $this->user;
367
        $user = $this->user;
Línea 382... Línea 382...
382
    /**
382
    /**
383
     * Test can_export_discussions.
383
     * Test can_export_discussions.
384
     *
384
     *
385
     * @covers ::can_export_discussions
385
     * @covers ::can_export_discussions
386
     */
386
     */
387
    public function test_can_export_discussions() {
387
    public function test_can_export_discussions(): void {
388
        global $CFG;
388
        global $CFG;
389
        $this->resetAfterTest();
389
        $this->resetAfterTest();
Línea 390... Línea 390...
390
 
390
 
391
        $CFG->enableportfolios = true;
391
        $CFG->enableportfolios = true;
Línea 407... Línea 407...
407
    /**
407
    /**
408
     * Test can_manually_control_post_read_status.
408
     * Test can_manually_control_post_read_status.
409
     *
409
     *
410
     * @covers ::can_manually_control_post_read_status
410
     * @covers ::can_manually_control_post_read_status
411
     */
411
     */
412
    public function test_can_manually_control_post_read_status() {
412
    public function test_can_manually_control_post_read_status(): void {
413
        global $CFG, $DB;
413
        global $CFG, $DB;
414
        $this->resetAfterTest();
414
        $this->resetAfterTest();
Línea 415... Línea 415...
415
 
415
 
416
        $CFG->forum_usermarksread = true;
416
        $CFG->forum_usermarksread = true;
Línea 436... Línea 436...
436
    /**
436
    /**
437
     * Test must_post_before_viewing_discussion.
437
     * Test must_post_before_viewing_discussion.
438
     *
438
     *
439
     * @covers ::must_post_before_viewing_discussion
439
     * @covers ::must_post_before_viewing_discussion
440
     */
440
     */
441
    public function test_must_post_before_viewing_discussion() {
441
    public function test_must_post_before_viewing_discussion(): void {
442
        $this->resetAfterTest();
442
        $this->resetAfterTest();
Línea 443... Línea 443...
443
 
443
 
444
        $forum = $this->create_forum();
444
        $forum = $this->create_forum();
445
        $user = $this->user;
445
        $user = $this->user;
Línea 467... Línea 467...
467
    /**
467
    /**
468
     * Test can_subscribe_to_discussion.
468
     * Test can_subscribe_to_discussion.
469
     *
469
     *
470
     * @covers ::can_subscribe_to_discussion
470
     * @covers ::can_subscribe_to_discussion
471
     */
471
     */
472
    public function test_can_subscribe_to_discussion() {
472
    public function test_can_subscribe_to_discussion(): void {
473
        $this->resetAfterTest();
473
        $this->resetAfterTest();
Línea 474... Línea 474...
474
 
474
 
475
        $forum = $this->create_forum();
475
        $forum = $this->create_forum();
476
        $discussion = $this->discussion;
476
        $discussion = $this->discussion;
Línea 484... Línea 484...
484
    /**
484
    /**
485
     * Test can_move_discussion.
485
     * Test can_move_discussion.
486
     *
486
     *
487
     * @covers ::can_move_discussion
487
     * @covers ::can_move_discussion
488
     */
488
     */
489
    public function test_can_move_discussion() {
489
    public function test_can_move_discussion(): void {
490
        $this->resetAfterTest();
490
        $this->resetAfterTest();
Línea 491... Línea 491...
491
 
491
 
492
        $forum = $this->create_forum();
492
        $forum = $this->create_forum();
493
        $discussion = $this->discussion;
493
        $discussion = $this->discussion;
Línea 509... Línea 509...
509
    /**
509
    /**
510
     * Test can_pin_discussion.
510
     * Test can_pin_discussion.
511
     *
511
     *
512
     * @covers ::can_pin_discussion
512
     * @covers ::can_pin_discussion
513
     */
513
     */
514
    public function test_can_pin_discussion() {
514
    public function test_can_pin_discussion(): void {
515
        $this->resetAfterTest();
515
        $this->resetAfterTest();
Línea 516... Línea 516...
516
 
516
 
517
        $forum = $this->create_forum();
517
        $forum = $this->create_forum();
518
        $discussion = $this->discussion;
518
        $discussion = $this->discussion;
Línea 529... Línea 529...
529
    /**
529
    /**
530
     * Test can_post_in_discussion.
530
     * Test can_post_in_discussion.
531
     *
531
     *
532
     * @covers ::can_post_in_discussion
532
     * @covers ::can_post_in_discussion
533
     */
533
     */
534
    public function test_can_post_in_discussion() {
534
    public function test_can_post_in_discussion(): void {
535
        $this->resetAfterTest();
535
        $this->resetAfterTest();
Línea 536... Línea 536...
536
 
536
 
537
        $discussion = $this->discussion;
537
        $discussion = $this->discussion;
Línea 647... Línea 647...
647
    /**
647
    /**
648
     * Test can_edit_post.
648
     * Test can_edit_post.
649
     *
649
     *
650
     * @covers ::can_edit_post
650
     * @covers ::can_edit_post
651
     */
651
     */
652
    public function test_can_edit_post() {
652
    public function test_can_edit_post(): void {
653
        global $CFG;
653
        global $CFG;
Línea 654... Línea 654...
654
 
654
 
Línea 655... Línea 655...
655
        $this->resetAfterTest();
655
        $this->resetAfterTest();
Línea 745... Línea 745...
745
    /**
745
    /**
746
     * Test can_delete_post.
746
     * Test can_delete_post.
747
     *
747
     *
748
     * @covers ::can_delete_post
748
     * @covers ::can_delete_post
749
     */
749
     */
750
    public function test_can_delete_post() {
750
    public function test_can_delete_post(): void {
751
        global $CFG;
751
        global $CFG;
Línea 752... Línea 752...
752
 
752
 
Línea 753... Línea 753...
753
        $this->resetAfterTest();
753
        $this->resetAfterTest();
Línea 822... Línea 822...
822
    /**
822
    /**
823
     * Test can_split_post.
823
     * Test can_split_post.
824
     *
824
     *
825
     * @covers ::can_split_post
825
     * @covers ::can_split_post
826
     */
826
     */
827
    public function test_can_split_post() {
827
    public function test_can_split_post(): void {
828
        $this->resetAfterTest();
828
        $this->resetAfterTest();
Línea 829... Línea 829...
829
 
829
 
830
        $forum = $this->create_forum();
830
        $forum = $this->create_forum();
831
        $user = $this->user;
831
        $user = $this->user;
Línea 873... Línea 873...
873
    /**
873
    /**
874
     * Test can_reply_to_post.
874
     * Test can_reply_to_post.
875
     *
875
     *
876
     * @covers ::can_reply_to_post
876
     * @covers ::can_reply_to_post
877
     */
877
     */
878
    public function test_can_reply_to_post() {
878
    public function test_can_reply_to_post(): void {
879
        $this->resetAfterTest();
879
        $this->resetAfterTest();
Línea 880... Línea 880...
880
 
880
 
881
        $discussion = $this->discussion;
881
        $discussion = $this->discussion;
882
        $user = $this->user;
882
        $user = $this->user;
Línea 986... Línea 986...
986
    }
986
    }
Línea 987... Línea 987...
987
 
987
 
988
    /**
988
    /**
989
     * Test for \mod_forum\local\managers\capability::can_reply_to_post() involving Q & A forums.
989
     * Test for \mod_forum\local\managers\capability::can_reply_to_post() involving Q & A forums.
990
     */
990
     */
991
    public function test_can_reply_to_post_in_qanda_forum() {
991
    public function test_can_reply_to_post_in_qanda_forum(): void {
Línea 992... Línea 992...
992
        global $CFG;
992
        global $CFG;
Línea 993... Línea 993...
993
 
993
 
Línea 1034... Línea 1034...
1034
    /**
1034
    /**
1035
     * Ensure that can_reply_privately_to_post works as expected.
1035
     * Ensure that can_reply_privately_to_post works as expected.
1036
     *
1036
     *
1037
     * @covers ::can_reply_privately_to_post
1037
     * @covers ::can_reply_privately_to_post
1038
     */
1038
     */
1039
    public function test_can_reply_privately_to_post() {
1039
    public function test_can_reply_privately_to_post(): void {
1040
        $this->resetAfterTest();
1040
        $this->resetAfterTest();
Línea 1041... Línea 1041...
1041
 
1041
 
1042
        $forum = $this->create_forum();
1042
        $forum = $this->create_forum();
1043
        $discussion = $this->discussion;
1043
        $discussion = $this->discussion;
Línea 1065... Línea 1065...
1065
    /**
1065
    /**
1066
     * Ensure that can_view_post works as expected.
1066
     * Ensure that can_view_post works as expected.
1067
     *
1067
     *
1068
     * @covers ::can_view_post
1068
     * @covers ::can_view_post
1069
     */
1069
     */
1070
    public function test_can_view_post() {
1070
    public function test_can_view_post(): void {
1071
        $this->resetAfterTest();
1071
        $this->resetAfterTest();
Línea 1072... Línea 1072...
1072
 
1072
 
1073
        $forum = $this->create_forum();
1073
        $forum = $this->create_forum();
Línea 1091... Línea 1091...
1091
    /**
1091
    /**
1092
     * Ensure that can_view_post_shell considers private replies correctly.
1092
     * Ensure that can_view_post_shell considers private replies correctly.
1093
     *
1093
     *
1094
     * @covers ::can_view_post_shell
1094
     * @covers ::can_view_post_shell
1095
     */
1095
     */
1096
    public function test_can_view_post_shell() {
1096
    public function test_can_view_post_shell(): void {
1097
        $this->resetAfterTest();
1097
        $this->resetAfterTest();
Línea 1098... Línea 1098...
1098
 
1098
 
1099
        $forum = $this->create_forum();
1099
        $forum = $this->create_forum();
Línea 1144... Línea 1144...
1144
    /**
1144
    /**
1145
     * Test can_export_post.
1145
     * Test can_export_post.
1146
     *
1146
     *
1147
     * @covers ::can_export_post
1147
     * @covers ::can_export_post
1148
     */
1148
     */
1149
    public function test_can_export_post() {
1149
    public function test_can_export_post(): void {
1150
        global $CFG;
1150
        global $CFG;
1151
        $this->resetAfterTest();
1151
        $this->resetAfterTest();
Línea 1152... Línea 1152...
1152
 
1152
 
1153
        $forum = $this->create_forum();
1153
        $forum = $this->create_forum();
Línea 1182... Línea 1182...
1182
    /**
1182
    /**
1183
     * Test can_view_participants.
1183
     * Test can_view_participants.
1184
     *
1184
     *
1185
     * @covers ::can_view_participants
1185
     * @covers ::can_view_participants
1186
     */
1186
     */
1187
    public function test_can_view_participants() {
1187
    public function test_can_view_participants(): void {
1188
        $this->resetAfterTest();
1188
        $this->resetAfterTest();
Línea 1189... Línea 1189...
1189
 
1189
 
1190
        $discussion = $this->discussion;
1190
        $discussion = $this->discussion;
1191
        $user = $this->user;
1191
        $user = $this->user;
Línea 1223... Línea 1223...
1223
    /**
1223
    /**
1224
     * Test can_view_hidden_posts.
1224
     * Test can_view_hidden_posts.
1225
     *
1225
     *
1226
     * @covers ::can_view_hidden_posts
1226
     * @covers ::can_view_hidden_posts
1227
     */
1227
     */
1228
    public function test_can_view_hidden_posts() {
1228
    public function test_can_view_hidden_posts(): void {
1229
        $this->resetAfterTest();
1229
        $this->resetAfterTest();
Línea 1230... Línea 1230...
1230
 
1230
 
1231
        $forum = $this->create_forum();
1231
        $forum = $this->create_forum();
1232
        $user = $this->user;
1232
        $user = $this->user;
Línea 1242... Línea 1242...
1242
    /**
1242
    /**
1243
     * Test can_manage_forum.
1243
     * Test can_manage_forum.
1244
     *
1244
     *
1245
     * @covers ::can_manage_forum
1245
     * @covers ::can_manage_forum
1246
     */
1246
     */
1247
    public function test_can_manage_forum() {
1247
    public function test_can_manage_forum(): void {
1248
        $this->resetAfterTest();
1248
        $this->resetAfterTest();
Línea 1249... Línea 1249...
1249
 
1249
 
1250
        $forum = $this->create_forum();
1250
        $forum = $this->create_forum();
1251
        $user = $this->user;
1251
        $user = $this->user;
Línea 1261... Línea 1261...
1261
    /**
1261
    /**
1262
     * Test can_manage_tags.
1262
     * Test can_manage_tags.
1263
     *
1263
     *
1264
     * @covers ::can_manage_tags
1264
     * @covers ::can_manage_tags
1265
     */
1265
     */
1266
    public function test_can_manage_tags() {
1266
    public function test_can_manage_tags(): void {
1267
        global $DB;
1267
        global $DB;
1268
        $this->resetAfterTest();
1268
        $this->resetAfterTest();
Línea 1269... Línea 1269...
1269
 
1269
 
1270
        $forum = $this->create_forum();
1270
        $forum = $this->create_forum();
Línea 1283... Línea 1283...
1283
    /**
1283
    /**
1284
     * Ensure that the can_view_any_private_reply works as expected.
1284
     * Ensure that the can_view_any_private_reply works as expected.
1285
     *
1285
     *
1286
     * @covers ::can_view_any_private_reply
1286
     * @covers ::can_view_any_private_reply
1287
     */
1287
     */
1288
    public function test_can_view_any_private_reply() {
1288
    public function test_can_view_any_private_reply(): void {
1289
        $this->resetAfterTest();
1289
        $this->resetAfterTest();
Línea 1290... Línea 1290...
1290
 
1290
 
1291
        $forum = $this->create_forum();
1291
        $forum = $this->create_forum();
Línea 1299... Línea 1299...
1299
 
1299
 
1300
 
1300
 
1301
    /**
1301
    /**
1302
     * Test delete a post with ratings.
1302
     * Test delete a post with ratings.
1303
     */
1303
     */
1304
    public function test_validate_delete_post_with_ratings() {
1304
    public function test_validate_delete_post_with_ratings(): void {
Línea 1305... Línea 1305...
1305
        global $DB;
1305
        global $DB;
1306
        $this->resetAfterTest(true);
1306
        $this->resetAfterTest(true);
Línea 1341... Línea 1341...
1341
    }
1341
    }
Línea 1342... Línea 1342...
1342
 
1342
 
1343
    /**
1343
    /**
1344
     * Test delete a post with replies.
1344
     * Test delete a post with replies.
1345
     */
1345
     */
1346
    public function test_validate_delete_post_with_replies() {
1346
    public function test_validate_delete_post_with_replies(): void {
1347
        global $DB;
1347
        global $DB;
Línea 1348... Línea 1348...
1348
        $this->resetAfterTest(true);
1348
        $this->resetAfterTest(true);
1349
 
1349