Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 44... Línea 44...
44
        // We must clear the subscription caches. This has to be done both before each test, and after in case of other
44
        // We must clear the subscription caches. This has to be done both before each test, and after in case of other
45
        // tests using these functions.
45
        // tests using these functions.
46
        \mod_forum\subscriptions::reset_forum_cache();
46
        \mod_forum\subscriptions::reset_forum_cache();
47
    }
47
    }
Línea 48... Línea 48...
48
 
48
 
49
    public function test_forum_trigger_content_uploaded_event() {
49
    public function test_forum_trigger_content_uploaded_event(): void {
Línea 50... Línea 50...
50
        $this->resetAfterTest();
50
        $this->resetAfterTest();
51
 
51
 
52
        $user = $this->getDataGenerator()->create_user();
52
        $user = $this->getDataGenerator()->create_user();
Línea 93... Línea 93...
93
        $expected->content = $fakepost->message;
93
        $expected->content = $fakepost->message;
94
        $expected->pathnamehashes = array($fi->get_pathnamehash());
94
        $expected->pathnamehashes = array($fi->get_pathnamehash());
95
        $this->assertEventContextNotUsed($event);
95
        $this->assertEventContextNotUsed($event);
96
    }
96
    }
Línea 97... Línea 97...
97
 
97
 
98
    public function test_forum_get_courses_user_posted_in() {
98
    public function test_forum_get_courses_user_posted_in(): void {
Línea 99... Línea 99...
99
        $this->resetAfterTest();
99
        $this->resetAfterTest();
100
 
100
 
101
        $user1 = $this->getDataGenerator()->create_user();
101
        $user1 = $this->getDataGenerator()->create_user();
Línea 190... Línea 190...
190
    }
190
    }
Línea 191... Línea 191...
191
 
191
 
192
    /**
192
    /**
193
     * Test the logic in the forum_tp_can_track_forums() function.
193
     * Test the logic in the forum_tp_can_track_forums() function.
194
     */
194
     */
195
    public function test_forum_tp_can_track_forums() {
195
    public function test_forum_tp_can_track_forums(): void {
Línea 196... Línea 196...
196
        global $CFG;
196
        global $CFG;
Línea 197... Línea 197...
197
 
197
 
Línea 266... Línea 266...
266
    }
266
    }
Línea 267... Línea 267...
267
 
267
 
268
    /**
268
    /**
269
     * Test the logic in the test_forum_tp_is_tracked() function.
269
     * Test the logic in the test_forum_tp_is_tracked() function.
270
     */
270
     */
271
    public function test_forum_tp_is_tracked() {
271
    public function test_forum_tp_is_tracked(): void {
Línea 272... Línea 272...
272
        global $CFG;
272
        global $CFG;
Línea 273... Línea 273...
273
 
273
 
Línea 389... Línea 389...
389
    }
389
    }
Línea 390... Línea 390...
390
 
390
 
391
    /**
391
    /**
392
     * Test the logic in the forum_tp_get_course_unread_posts() function.
392
     * Test the logic in the forum_tp_get_course_unread_posts() function.
393
     */
393
     */
394
    public function test_forum_tp_get_course_unread_posts() {
394
    public function test_forum_tp_get_course_unread_posts(): void {
Línea 395... Línea 395...
395
        global $CFG;
395
        global $CFG;
Línea 396... Línea 396...
396
 
396
 
Línea 514... Línea 514...
514
    /**
514
    /**
515
     * Test the logic in the forum_tp_get_course_unread_posts() function when private replies are present.
515
     * Test the logic in the forum_tp_get_course_unread_posts() function when private replies are present.
516
     *
516
     *
517
     * @covers ::forum_tp_get_course_unread_posts
517
     * @covers ::forum_tp_get_course_unread_posts
518
     */
518
     */
519
    public function test_forum_tp_get_course_unread_posts_with_private_replies() {
519
    public function test_forum_tp_get_course_unread_posts_with_private_replies(): void {
520
        global $DB;
520
        global $DB;
Línea 521... Línea 521...
521
 
521
 
Línea 522... Línea 522...
522
        $this->resetAfterTest();
522
        $this->resetAfterTest();
Línea 641... Línea 641...
641
     * Test the logic in the forum_tp_count_forum_unread_posts() function when private replies are present but without
641
     * Test the logic in the forum_tp_count_forum_unread_posts() function when private replies are present but without
642
     * separate group mode. This should yield the same results returned by forum_tp_get_course_unread_posts().
642
     * separate group mode. This should yield the same results returned by forum_tp_get_course_unread_posts().
643
     *
643
     *
644
     * @covers ::forum_tp_count_forum_unread_posts
644
     * @covers ::forum_tp_count_forum_unread_posts
645
     */
645
     */
646
    public function test_forum_tp_count_forum_unread_posts_with_private_replies() {
646
    public function test_forum_tp_count_forum_unread_posts_with_private_replies(): void {
647
        global $DB;
647
        global $DB;
Línea 648... Línea 648...
648
 
648
 
Línea 649... Línea 649...
649
        $this->resetAfterTest();
649
        $this->resetAfterTest();
Línea 768... Línea 768...
768
    /**
768
    /**
769
     * Test the logic in the forum_tp_count_forum_unread_posts() function when private replies are present and group modes are set.
769
     * Test the logic in the forum_tp_count_forum_unread_posts() function when private replies are present and group modes are set.
770
     *
770
     *
771
     * @covers ::forum_tp_count_forum_unread_posts
771
     * @covers ::forum_tp_count_forum_unread_posts
772
     */
772
     */
773
    public function test_forum_tp_count_forum_unread_posts_with_private_replies_and_separate_groups() {
773
    public function test_forum_tp_count_forum_unread_posts_with_private_replies_and_separate_groups(): void {
774
        $this->resetAfterTest();
774
        $this->resetAfterTest();
Línea 775... Línea 775...
775
 
775
 
Línea 776... Línea 776...
776
        $generator = $this->getDataGenerator();
776
        $generator = $this->getDataGenerator();
Línea 876... Línea 876...
876
    }
876
    }
Línea 877... Línea 877...
877
 
877
 
878
    /**
878
    /**
879
     * Test the logic in the test_forum_tp_get_untracked_forums() function.
879
     * Test the logic in the test_forum_tp_get_untracked_forums() function.
880
     */
880
     */
881
    public function test_forum_tp_get_untracked_forums() {
881
    public function test_forum_tp_get_untracked_forums(): void {
Línea 882... Línea 882...
882
        global $CFG;
882
        global $CFG;
Línea 883... Línea 883...
883
 
883
 
Línea 964... Línea 964...
964
    }
964
    }
Línea 965... Línea 965...
965
 
965
 
966
    /**
966
    /**
967
     * Test subscription using automatic subscription on create.
967
     * Test subscription using automatic subscription on create.
968
     */
968
     */
969
    public function test_forum_auto_subscribe_on_create() {
969
    public function test_forum_auto_subscribe_on_create(): void {
Línea 970... Línea 970...
970
        global $CFG;
970
        global $CFG;
Línea 971... Línea 971...
971
 
971
 
Línea 992... Línea 992...
992
    }
992
    }
Línea 993... Línea 993...
993
 
993
 
994
    /**
994
    /**
995
     * Test subscription using forced subscription on create.
995
     * Test subscription using forced subscription on create.
996
     */
996
     */
997
    public function test_forum_forced_subscribe_on_create() {
997
    public function test_forum_forced_subscribe_on_create(): void {
Línea 998... Línea 998...
998
        global $CFG;
998
        global $CFG;
Línea 999... Línea 999...
999
 
999
 
Línea 1020... Línea 1020...
1020
    }
1020
    }
Línea 1021... Línea 1021...
1021
 
1021
 
1022
    /**
1022
    /**
1023
     * Test subscription using optional subscription on create.
1023
     * Test subscription using optional subscription on create.
1024
     */
1024
     */
1025
    public function test_forum_optional_subscribe_on_create() {
1025
    public function test_forum_optional_subscribe_on_create(): void {
Línea 1026... Línea 1026...
1026
        global $CFG;
1026
        global $CFG;
Línea 1027... Línea 1027...
1027
 
1027
 
Línea 1049... Línea 1049...
1049
    }
1049
    }
Línea 1050... Línea 1050...
1050
 
1050
 
1051
    /**
1051
    /**
1052
     * Test subscription using disallow subscription on create.
1052
     * Test subscription using disallow subscription on create.
1053
     */
1053
     */
1054
    public function test_forum_disallow_subscribe_on_create() {
1054
    public function test_forum_disallow_subscribe_on_create(): void {
Línea 1055... Línea 1055...
1055
        global $CFG;
1055
        global $CFG;
Línea 1056... Línea 1056...
1056
 
1056
 
Línea 1078... Línea 1078...
1078
    }
1078
    }
Línea 1079... Línea 1079...
1079
 
1079
 
1080
    /**
1080
    /**
1081
     * Test that context fetching returns the appropriate context.
1081
     * Test that context fetching returns the appropriate context.
1082
     */
1082
     */
1083
    public function test_forum_get_context() {
1083
    public function test_forum_get_context(): void {
Línea 1084... Línea 1084...
1084
        global $DB, $PAGE;
1084
        global $DB, $PAGE;
Línea 1085... Línea 1085...
1085
 
1085
 
Línea 1162... Línea 1162...
1162
    }
1162
    }
Línea 1163... Línea 1163...
1163
 
1163
 
1164
    /**
1164
    /**
1165
     * Test getting the neighbour threads of a discussion.
1165
     * Test getting the neighbour threads of a discussion.
1166
     */
1166
     */
1167
    public function test_forum_get_neighbours() {
1167
    public function test_forum_get_neighbours(): void {
1168
        global $CFG, $DB;
1168
        global $CFG, $DB;
Línea 1169... Línea 1169...
1169
        $this->resetAfterTest();
1169
        $this->resetAfterTest();
1170
 
1170
 
Línea 1411... Línea 1411...
1411
    }
1411
    }
Línea 1412... Línea 1412...
1412
 
1412
 
1413
    /**
1413
    /**
1414
     * Test getting the neighbour threads of a blog-like forum.
1414
     * Test getting the neighbour threads of a blog-like forum.
1415
     */
1415
     */
1416
    public function test_forum_get_neighbours_blog() {
1416
    public function test_forum_get_neighbours_blog(): void {
1417
        global $CFG, $DB;
1417
        global $CFG, $DB;
Línea 1418... Línea 1418...
1418
        $this->resetAfterTest();
1418
        $this->resetAfterTest();
1419
 
1419
 
Línea 1601... Línea 1601...
1601
    }
1601
    }
Línea 1602... Línea 1602...
1602
 
1602
 
1603
    /**
1603
    /**
1604
     * Test getting the neighbour threads of a discussion.
1604
     * Test getting the neighbour threads of a discussion.
1605
     */
1605
     */
1606
    public function test_forum_get_neighbours_with_groups() {
1606
    public function test_forum_get_neighbours_with_groups(): void {
Línea 1607... Línea 1607...
1607
        $this->resetAfterTest();
1607
        $this->resetAfterTest();
1608
 
1608
 
Línea 1798... Línea 1798...
1798
    }
1798
    }
Línea 1799... Línea 1799...
1799
 
1799
 
1800
    /**
1800
    /**
1801
     * Test getting the neighbour threads of a blog-like forum with groups involved.
1801
     * Test getting the neighbour threads of a blog-like forum with groups involved.
1802
     */
1802
     */
1803
    public function test_forum_get_neighbours_with_groups_blog() {
1803
    public function test_forum_get_neighbours_with_groups_blog(): void {
Línea 1804... Línea 1804...
1804
        $this->resetAfterTest();
1804
        $this->resetAfterTest();
1805
 
1805
 
Línea 1995... Línea 1995...
1995
        // Querying the neighbours of a discussion passing the wrong CM.
1995
        // Querying the neighbours of a discussion passing the wrong CM.
1996
        $this->expectException('coding_exception');
1996
        $this->expectException('coding_exception');
1997
        forum_get_discussion_neighbours($cm2, $disc11, $forum2);
1997
        forum_get_discussion_neighbours($cm2, $disc11, $forum2);
1998
    }
1998
    }
Línea 1999... Línea 1999...
1999
 
1999
 
2000
    public function test_count_discussion_replies_basic() {
2000
    public function test_count_discussion_replies_basic(): void {
Línea 2001... Línea 2001...
2001
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2001
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2002
 
2002
 
2003
        // Count the discussion replies in the forum.
2003
        // Count the discussion replies in the forum.
2004
        $result = forum_count_discussion_replies($forum->id);
2004
        $result = forum_count_discussion_replies($forum->id);
Línea 2005... Línea 2005...
2005
        $this->assertCount(10, $result);
2005
        $this->assertCount(10, $result);
2006
    }
2006
    }
2007
 
2007
 
2008
    public function test_count_discussion_replies_limited() {
2008
    public function test_count_discussion_replies_limited(): void {
2009
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2009
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2010
        // Adding limits shouldn't make a difference.
2010
        // Adding limits shouldn't make a difference.
Línea 2011... Línea 2011...
2011
        $result = forum_count_discussion_replies($forum->id, "", 20);
2011
        $result = forum_count_discussion_replies($forum->id, "", 20);
2012
        $this->assertCount(10, $result);
2012
        $this->assertCount(10, $result);
2013
    }
2013
    }
2014
 
2014
 
2015
    public function test_count_discussion_replies_paginated() {
2015
    public function test_count_discussion_replies_paginated(): void {
2016
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2016
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
Línea 2017... Línea 2017...
2017
        // Adding paging shouldn't make any difference.
2017
        // Adding paging shouldn't make any difference.
2018
        $result = forum_count_discussion_replies($forum->id, "", -1, 0, 100);
2018
        $result = forum_count_discussion_replies($forum->id, "", -1, 0, 100);
2019
        $this->assertCount(10, $result);
2019
        $this->assertCount(10, $result);
2020
    }
2020
    }
2021
 
2021
 
2022
    public function test_count_discussion_replies_paginated_sorted() {
2022
    public function test_count_discussion_replies_paginated_sorted(): void {
Línea 2029... Línea 2029...
2029
            $discussionid = array_shift($discussionids);
2029
            $discussionid = array_shift($discussionids);
2030
            $this->assertEquals($discussionid, $row->discussion);
2030
            $this->assertEquals($discussionid, $row->discussion);
2031
        }
2031
        }
2032
    }
2032
    }
Línea 2033... Línea 2033...
2033
 
2033
 
2034
    public function test_count_discussion_replies_limited_sorted() {
2034
    public function test_count_discussion_replies_limited_sorted(): void {
2035
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2035
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2036
        // Adding limits, and a forumsort shouldn't make a difference.
2036
        // Adding limits, and a forumsort shouldn't make a difference.
2037
        $result = forum_count_discussion_replies($forum->id, "d.id asc", 20);
2037
        $result = forum_count_discussion_replies($forum->id, "d.id asc", 20);
2038
        $this->assertCount(10, $result);
2038
        $this->assertCount(10, $result);
Línea 2041... Línea 2041...
2041
            $discussionid = array_shift($discussionids);
2041
            $discussionid = array_shift($discussionids);
2042
            $this->assertEquals($discussionid, $row->discussion);
2042
            $this->assertEquals($discussionid, $row->discussion);
2043
        }
2043
        }
2044
    }
2044
    }
Línea 2045... Línea 2045...
2045
 
2045
 
2046
    public function test_count_discussion_replies_paginated_sorted_small() {
2046
    public function test_count_discussion_replies_paginated_sorted_small(): void {
2047
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2047
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2048
        // Grabbing a smaller subset and they should be ordered as expected.
2048
        // Grabbing a smaller subset and they should be ordered as expected.
2049
        $result = forum_count_discussion_replies($forum->id, "d.id asc", -1, 0, 5);
2049
        $result = forum_count_discussion_replies($forum->id, "d.id asc", -1, 0, 5);
2050
        $this->assertCount(5, $result);
2050
        $this->assertCount(5, $result);
Línea 2053... Línea 2053...
2053
            $discussionid = array_shift($discussionids);
2053
            $discussionid = array_shift($discussionids);
2054
            $this->assertEquals($discussionid, $row->discussion);
2054
            $this->assertEquals($discussionid, $row->discussion);
2055
        }
2055
        }
2056
    }
2056
    }
Línea 2057... Línea 2057...
2057
 
2057
 
2058
    public function test_count_discussion_replies_paginated_sorted_small_reverse() {
2058
    public function test_count_discussion_replies_paginated_sorted_small_reverse(): void {
2059
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2059
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2060
        // Grabbing a smaller subset and they should be ordered as expected.
2060
        // Grabbing a smaller subset and they should be ordered as expected.
2061
        $result = forum_count_discussion_replies($forum->id, "d.id desc", -1, 0, 5);
2061
        $result = forum_count_discussion_replies($forum->id, "d.id desc", -1, 0, 5);
2062
        $this->assertCount(5, $result);
2062
        $this->assertCount(5, $result);
Línea 2065... Línea 2065...
2065
            $discussionid = array_pop($discussionids);
2065
            $discussionid = array_pop($discussionids);
2066
            $this->assertEquals($discussionid, $row->discussion);
2066
            $this->assertEquals($discussionid, $row->discussion);
2067
        }
2067
        }
2068
    }
2068
    }
Línea 2069... Línea 2069...
2069
 
2069
 
2070
    public function test_count_discussion_replies_limited_sorted_small_reverse() {
2070
    public function test_count_discussion_replies_limited_sorted_small_reverse(): void {
2071
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2071
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2072
        // Adding limits, and a forumsort shouldn't make a difference.
2072
        // Adding limits, and a forumsort shouldn't make a difference.
2073
        $result = forum_count_discussion_replies($forum->id, "d.id desc", 5);
2073
        $result = forum_count_discussion_replies($forum->id, "d.id desc", 5);
2074
        $this->assertCount(5, $result);
2074
        $this->assertCount(5, $result);
Línea 2080... Línea 2080...
2080
    }
2080
    }
Línea 2081... Línea 2081...
2081
 
2081
 
2082
    /**
2082
    /**
2083
     * Test the reply count when used with private replies.
2083
     * Test the reply count when used with private replies.
2084
     */
2084
     */
2085
    public function test_forum_count_discussion_replies_private() {
2085
    public function test_forum_count_discussion_replies_private(): void {
2086
        global $DB;
2086
        global $DB;
Línea 2087... Línea 2087...
2087
        $this->resetAfterTest();
2087
        $this->resetAfterTest();
2088
 
2088
 
Línea 2151... Línea 2151...
2151
        $this->setUser($otheruser->id);
2151
        $this->setUser($otheruser->id);
2152
        $counts = forum_count_discussion_replies($forum->id);
2152
        $counts = forum_count_discussion_replies($forum->id);
2153
        $this->assertEquals($replycount, $counts[$discussion->id]->replies);
2153
        $this->assertEquals($replycount, $counts[$discussion->id]->replies);
2154
    }
2154
    }
Línea 2155... Línea 2155...
2155
 
2155
 
2156
    public function test_discussion_pinned_sort() {
2156
    public function test_discussion_pinned_sort(): void {
2157
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2157
        list($forum, $discussionids) = $this->create_multiple_discussions_with_replies(10, 5);
2158
        $cm = get_coursemodule_from_instance('forum', $forum->id);
2158
        $cm = get_coursemodule_from_instance('forum', $forum->id);
2159
        $discussions = forum_get_discussions($cm);
2159
        $discussions = forum_get_discussions($cm);
2160
        // First discussion should be pinned.
2160
        // First discussion should be pinned.
2161
        $first = reset($discussions);
2161
        $first = reset($discussions);
2162
        $this->assertEquals(1, $first->pinned, "First discussion should be pinned discussion");
2162
        $this->assertEquals(1, $first->pinned, "First discussion should be pinned discussion");
2163
    }
2163
    }
2164
    public function test_forum_view() {
2164
    public function test_forum_view(): void {
Línea 2165... Línea 2165...
2165
        global $CFG;
2165
        global $CFG;
2166
 
2166
 
Línea 2201... Línea 2201...
2201
    }
2201
    }
Línea 2202... Línea 2202...
2202
 
2202
 
2203
    /**
2203
    /**
2204
     * Test forum_discussion_view.
2204
     * Test forum_discussion_view.
2205
     */
2205
     */
2206
    public function test_forum_discussion_view() {
2206
    public function test_forum_discussion_view(): void {
Línea 2207... Línea 2207...
2207
        global $CFG, $USER;
2207
        global $CFG, $USER;
Línea 2208... Línea 2208...
2208
 
2208
 
Línea 2341... Línea 2341...
2341
     * Tests for mod_forum_rating_can_see_item_ratings().
2341
     * Tests for mod_forum_rating_can_see_item_ratings().
2342
     *
2342
     *
2343
     * @throws coding_exception
2343
     * @throws coding_exception
2344
     * @throws rating_exception
2344
     * @throws rating_exception
2345
     */
2345
     */
2346
    public function test_mod_forum_rating_can_see_item_ratings() {
2346
    public function test_mod_forum_rating_can_see_item_ratings(): void {
2347
        global $DB;
2347
        global $DB;
Línea 2348... Línea 2348...
2348
 
2348
 
Línea 2349... Línea 2349...
2349
        $this->resetAfterTest();
2349
        $this->resetAfterTest();
Línea 2441... Línea 2441...
2441
    }
2441
    }
Línea 2442... Línea 2442...
2442
 
2442
 
2443
    /**
2443
    /**
2444
     * Test forum_get_discussions
2444
     * Test forum_get_discussions
2445
     */
2445
     */
2446
    public function test_forum_get_discussions_with_groups() {
2446
    public function test_forum_get_discussions_with_groups(): void {
Línea 2447... Línea 2447...
2447
        global $DB;
2447
        global $DB;
Línea 2448... Línea 2448...
2448
 
2448
 
Línea 2560... Línea 2560...
2560
    }
2560
    }
Línea 2561... Línea 2561...
2561
 
2561
 
2562
    /**
2562
    /**
2563
     * Test forum_user_can_post_discussion
2563
     * Test forum_user_can_post_discussion
2564
     */
2564
     */
2565
    public function test_forum_user_can_post_discussion() {
2565
    public function test_forum_user_can_post_discussion(): void {
Línea 2566... Línea 2566...
2566
        global $DB;
2566
        global $DB;
Línea 2567... Línea 2567...
2567
 
2567
 
Línea 2661... Línea 2661...
2661
    }
2661
    }
Línea 2662... Línea 2662...
2662
 
2662
 
2663
    /**
2663
    /**
2664
     * Test forum_user_can_post_discussion_after_cutoff
2664
     * Test forum_user_can_post_discussion_after_cutoff
2665
     */
2665
     */
2666
    public function test_forum_user_can_post_discussion_after_cutoff() {
2666
    public function test_forum_user_can_post_discussion_after_cutoff(): void {
Línea 2667... Línea 2667...
2667
        $this->resetAfterTest(true);
2667
        $this->resetAfterTest(true);
2668
 
2668
 
2669
        // Create course to add the module.
2669
        // Create course to add the module.
Línea 2695... Línea 2695...
2695
    }
2695
    }
Línea 2696... Línea 2696...
2696
 
2696
 
2697
    /**
2697
    /**
2698
     * Test forum_user_has_posted_discussion with no groups.
2698
     * Test forum_user_has_posted_discussion with no groups.
2699
     */
2699
     */
2700
    public function test_forum_user_has_posted_discussion_no_groups() {
2700
    public function test_forum_user_has_posted_discussion_no_groups(): void {
Línea 2701... Línea 2701...
2701
        global $CFG;
2701
        global $CFG;
Línea 2702... Línea 2702...
2702
 
2702
 
Línea 2727... Línea 2727...
2727
    }
2727
    }
Línea 2728... Línea 2728...
2728
 
2728
 
2729
    /**
2729
    /**
2730
     * Test forum_user_has_posted_discussion with multiple forums
2730
     * Test forum_user_has_posted_discussion with multiple forums
2731
     */
2731
     */
2732
    public function test_forum_user_has_posted_discussion_multiple_forums() {
2732
    public function test_forum_user_has_posted_discussion_multiple_forums(): void {
Línea 2733... Línea 2733...
2733
        global $CFG;
2733
        global $CFG;
Línea 2734... Línea 2734...
2734
 
2734
 
Línea 2759... Línea 2759...
2759
    }
2759
    }
Línea 2760... Línea 2760...
2760
 
2760
 
2761
    /**
2761
    /**
2762
     * Test forum_user_has_posted_discussion with multiple groups.
2762
     * Test forum_user_has_posted_discussion with multiple groups.
2763
     */
2763
     */
2764
    public function test_forum_user_has_posted_discussion_multiple_groups() {
2764
    public function test_forum_user_has_posted_discussion_multiple_groups(): void {
Línea 2765... Línea 2765...
2765
        global $CFG;
2765
        global $CFG;
Línea 2766... Línea 2766...
2766
 
2766
 
Línea 2816... Línea 2816...
2816
    /**
2816
    /**
2817
     * Test the logic for forum_get_user_posted_mailnow where the user can select if qanda forum post should be sent without delay
2817
     * Test the logic for forum_get_user_posted_mailnow where the user can select if qanda forum post should be sent without delay
2818
     *
2818
     *
2819
     * @covers ::forum_get_user_posted_mailnow
2819
     * @covers ::forum_get_user_posted_mailnow
2820
     */
2820
     */
2821
    public function test_forum_get_user_posted_mailnow() {
2821
    public function test_forum_get_user_posted_mailnow(): void {
2822
        $this->resetAfterTest();
2822
        $this->resetAfterTest();
Línea 2823... Línea 2823...
2823
 
2823
 
2824
        // Create a forum.
2824
        // Create a forum.
2825
        $course = $this->getDataGenerator()->create_course();
2825
        $course = $this->getDataGenerator()->create_course();
Línea 2848... Línea 2848...
2848
    }
2848
    }
Línea 2849... Línea 2849...
2849
 
2849
 
2850
    /**
2850
    /**
2851
     * Tests the mod_forum_myprofile_navigation() function.
2851
     * Tests the mod_forum_myprofile_navigation() function.
2852
     */
2852
     */
2853
    public function test_mod_forum_myprofile_navigation() {
2853
    public function test_mod_forum_myprofile_navigation(): void {
Línea 2854... Línea 2854...
2854
        $this->resetAfterTest(true);
2854
        $this->resetAfterTest(true);
2855
 
2855
 
2856
        // Set up the test.
2856
        // Set up the test.
Línea 2871... Línea 2871...
2871
    }
2871
    }
Línea 2872... Línea 2872...
2872
 
2872
 
2873
    /**
2873
    /**
2874
     * Tests the mod_forum_myprofile_navigation() function as a guest.
2874
     * Tests the mod_forum_myprofile_navigation() function as a guest.
2875
     */
2875
     */
2876
    public function test_mod_forum_myprofile_navigation_as_guest() {
2876
    public function test_mod_forum_myprofile_navigation_as_guest(): void {
Línea 2877... Línea 2877...
2877
        global $USER;
2877
        global $USER;
Línea 2878... Línea 2878...
2878
 
2878
 
Línea 2895... Línea 2895...
2895
    }
2895
    }
Línea 2896... Línea 2896...
2896
 
2896
 
2897
    /**
2897
    /**
2898
     * Tests the mod_forum_myprofile_navigation() function as a user viewing another user's profile.
2898
     * Tests the mod_forum_myprofile_navigation() function as a user viewing another user's profile.
2899
     */
2899
     */
2900
    public function test_mod_forum_myprofile_navigation_different_user() {
2900
    public function test_mod_forum_myprofile_navigation_different_user(): void {
Línea 2901... Línea 2901...
2901
        $this->resetAfterTest(true);
2901
        $this->resetAfterTest(true);
2902
 
2902
 
2903
        // Set up the test.
2903
        // Set up the test.
Línea 2919... Línea 2919...
2919
    }
2919
    }
Línea 2920... Línea 2920...
2920
 
2920
 
2921
    /**
2921
    /**
2922
     * Test test_pinned_discussion_with_group.
2922
     * Test test_pinned_discussion_with_group.
2923
     */
2923
     */
2924
    public function test_pinned_discussion_with_group() {
2924
    public function test_pinned_discussion_with_group(): void {
Línea 2925... Línea 2925...
2925
        global $SESSION;
2925
        global $SESSION;
2926
 
2926
 
2927
        $this->resetAfterTest();
2927
        $this->resetAfterTest();
Línea 3047... Línea 3047...
3047
    }
3047
    }
Línea 3048... Línea 3048...
3048
 
3048
 
3049
    /**
3049
    /**
3050
     * Test test_pinned_with_timed_discussions.
3050
     * Test test_pinned_with_timed_discussions.
3051
     */
3051
     */
3052
    public function test_pinned_with_timed_discussions() {
3052
    public function test_pinned_with_timed_discussions(): void {
Línea 3053... Línea 3053...
3053
        global $CFG;
3053
        global $CFG;
Línea 3054... Línea 3054...
3054
 
3054
 
Línea 3119... Línea 3119...
3119
    }
3119
    }
Línea 3120... Línea 3120...
3120
 
3120
 
3121
    /**
3121
    /**
3122
     * Test test_pinned_timed_discussions_with_timed_discussions.
3122
     * Test test_pinned_timed_discussions_with_timed_discussions.
3123
     */
3123
     */
3124
    public function test_pinned_timed_discussions_with_timed_discussions() {
3124
    public function test_pinned_timed_discussions_with_timed_discussions(): void {
Línea 3125... Línea 3125...
3125
        global $CFG;
3125
        global $CFG;
Línea 3126... Línea 3126...
3126
 
3126
 
Línea 3202... Línea 3202...
3202
    }
3202
    }
Línea 3203... Línea 3203...
3203
 
3203
 
3204
    /**
3204
    /**
3205
     * Test for forum_is_author_hidden.
3205
     * Test for forum_is_author_hidden.
3206
     */
3206
     */
3207
    public function test_forum_is_author_hidden() {
3207
    public function test_forum_is_author_hidden(): void {
3208
        // First post, different forum type.
3208
        // First post, different forum type.
3209
        $post = (object) ['parent' => 0];
3209
        $post = (object) ['parent' => 0];
3210
        $forum = (object) ['type' => 'standard'];
3210
        $forum = (object) ['type' => 'standard'];
Línea 3242... Línea 3242...
3242
     * @dataProvider forum_discussion_is_locked_provider
3242
     * @dataProvider forum_discussion_is_locked_provider
3243
     * @param   \stdClass $forum
3243
     * @param   \stdClass $forum
3244
     * @param   \stdClass $discussion
3244
     * @param   \stdClass $discussion
3245
     * @param   bool        $expect
3245
     * @param   bool        $expect
3246
     */
3246
     */
3247
    public function test_forum_discussion_is_locked($forum, $discussion, $expect) {
3247
    public function test_forum_discussion_is_locked($forum, $discussion, $expect): void {
3248
        $this->resetAfterTest();
3248
        $this->resetAfterTest();
Línea 3249... Línea 3249...
3249
 
3249
 
3250
        $datagenerator = $this->getDataGenerator();
3250
        $datagenerator = $this->getDataGenerator();
Línea 3304... Línea 3304...
3304
     *
3304
     *
3305
     * @dataProvider forum_is_cutoff_date_reached_provider
3305
     * @dataProvider forum_is_cutoff_date_reached_provider
3306
     * @param   array   $forum
3306
     * @param   array   $forum
3307
     * @param   bool    $expect
3307
     * @param   bool    $expect
3308
     */
3308
     */
3309
    public function test_forum_is_cutoff_date_reached($forum, $expect) {
3309
    public function test_forum_is_cutoff_date_reached($forum, $expect): void {
3310
        $this->resetAfterTest();
3310
        $this->resetAfterTest();
Línea 3311... Línea 3311...
3311
 
3311
 
3312
        $datagenerator = $this->getDataGenerator();
3312
        $datagenerator = $this->getDataGenerator();
3313
        $course = $datagenerator->create_course();
3313
        $course = $datagenerator->create_course();
Línea 3350... Línea 3350...
3350
     *
3350
     *
3351
     * @dataProvider forum_is_due_date_reached_provider
3351
     * @dataProvider forum_is_due_date_reached_provider
3352
     * @param   \stdClass $forum
3352
     * @param   \stdClass $forum
3353
     * @param   bool        $expect
3353
     * @param   bool        $expect
3354
     */
3354
     */
3355
    public function test_forum_is_due_date_reached($forum, $expect) {
3355
    public function test_forum_is_due_date_reached($forum, $expect): void {
3356
        $this->resetAfterTest();
3356
        $this->resetAfterTest();
Línea 3357... Línea 3357...
3357
 
3357
 
Línea 3358... Línea 3358...
3358
        $this->setAdminUser();
3358
        $this->setAdminUser();
Línea 3394... Línea 3394...
3394
    }
3394
    }
Línea 3395... Línea 3395...
3395
 
3395
 
3396
    /**
3396
    /**
3397
     * Test that {@link forum_update_post()} keeps correct forum_discussions usermodified.
3397
     * Test that {@link forum_update_post()} keeps correct forum_discussions usermodified.
3398
     */
3398
     */
3399
    public function test_forum_update_post_keeps_discussions_usermodified() {
3399
    public function test_forum_update_post_keeps_discussions_usermodified(): void {
Línea 3400... Línea 3400...
3400
        global $DB;
3400
        global $DB;
Línea 3401... Línea 3401...
3401
 
3401
 
Línea 3486... Línea 3486...
3486
 
3486
 
3487
        // The post time should be updated.
3487
        // The post time should be updated.
3488
        $this->assertGreaterThan($pasttime, $DB->get_field('forum_posts', 'modified', ['id' => $reply->id]));
3488
        $this->assertGreaterThan($pasttime, $DB->get_field('forum_posts', 'modified', ['id' => $reply->id]));
Línea 3489... Línea 3489...
3489
    }
3489
    }
3490
 
3490
 
3491
    public function test_forum_core_calendar_provide_event_action() {
3491
    public function test_forum_core_calendar_provide_event_action(): void {
Línea 3492... Línea 3492...
3492
        $this->resetAfterTest();
3492
        $this->resetAfterTest();
3493
        $this->setAdminUser();
3493
        $this->setAdminUser();
Línea 3513... Línea 3513...
3513
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
3513
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
3514
        $this->assertEquals(7, $actionevent->get_item_count());
3514
        $this->assertEquals(7, $actionevent->get_item_count());
3515
        $this->assertTrue($actionevent->is_actionable());
3515
        $this->assertTrue($actionevent->is_actionable());
3516
    }
3516
    }
Línea 3517... Línea 3517...
3517
 
3517
 
3518
    public function test_forum_core_calendar_provide_event_action_in_hidden_section() {
3518
    public function test_forum_core_calendar_provide_event_action_in_hidden_section(): void {
Línea 3519... Línea 3519...
3519
        global $CFG;
3519
        global $CFG;
3520
 
3520
 
Línea 3550... Línea 3550...
3550
 
3550
 
3551
        // Confirm the event is not shown at all.
3551
        // Confirm the event is not shown at all.
3552
        $this->assertNull($actionevent);
3552
        $this->assertNull($actionevent);
Línea 3553... Línea 3553...
3553
    }
3553
    }
3554
 
3554
 
Línea 3555... Línea 3555...
3555
    public function test_forum_core_calendar_provide_event_action_for_user() {
3555
    public function test_forum_core_calendar_provide_event_action_for_user(): void {
3556
        global $CFG;
3556
        global $CFG;
Línea 3588... Línea 3588...
3588
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
3588
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
3589
        $this->assertEquals(7, $actionevent->get_item_count());
3589
        $this->assertEquals(7, $actionevent->get_item_count());
3590
        $this->assertTrue($actionevent->is_actionable());
3590
        $this->assertTrue($actionevent->is_actionable());
3591
    }
3591
    }
Línea 3592... Línea 3592...
3592
 
3592
 
3593
    public function test_forum_core_calendar_provide_event_action_as_non_user() {
3593
    public function test_forum_core_calendar_provide_event_action_as_non_user(): void {
Línea 3594... Línea 3594...
3594
        global $CFG;
3594
        global $CFG;
3595
 
3595
 
Línea 3616... Línea 3616...
3616
 
3616
 
3617
        // Ensure result was null.
3617
        // Ensure result was null.
3618
        $this->assertNull($actionevent);
3618
        $this->assertNull($actionevent);
Línea 3619... Línea 3619...
3619
    }
3619
    }
3620
 
3620
 
Línea 3621... Línea 3621...
3621
    public function test_forum_core_calendar_provide_event_action_already_completed() {
3621
    public function test_forum_core_calendar_provide_event_action_already_completed(): void {
3622
        global $CFG;
3622
        global $CFG;
Línea 3650... Línea 3650...
3650
 
3650
 
3651
        // Ensure result was null.
3651
        // Ensure result was null.
3652
        $this->assertNull($actionevent);
3652
        $this->assertNull($actionevent);
Línea 3653... Línea 3653...
3653
    }
3653
    }
3654
 
3654
 
Línea 3655... Línea 3655...
3655
    public function test_forum_core_calendar_provide_event_action_already_completed_for_user() {
3655
    public function test_forum_core_calendar_provide_event_action_already_completed_for_user(): void {
3656
        global $CFG;
3656
        global $CFG;
Línea 3689... Línea 3689...
3689
 
3689
 
3690
        // Ensure result was null.
3690
        // Ensure result was null.
3691
        $this->assertNull($actionevent);
3691
        $this->assertNull($actionevent);
Línea 3692... Línea 3692...
3692
    }
3692
    }
3693
 
3693
 
Línea 3694... Línea 3694...
3694
    public function test_mod_forum_get_tagged_posts() {
3694
    public function test_mod_forum_get_tagged_posts(): void {
3695
        global $DB;
3695
        global $DB;
Línea 3803... Línea 3803...
3803
    /**
3803
    /**
3804
     * Test the callback responsible for returning the completion rule descriptions.
3804
     * Test the callback responsible for returning the completion rule descriptions.
3805
     * This function should work given either an instance of the module (cm_info), such as when checking the active rules,
3805
     * This function should work given either an instance of the module (cm_info), such as when checking the active rules,
3806
     * or if passed a stdClass of similar structure, such as when checking the the default completion settings for a mod type.
3806
     * or if passed a stdClass of similar structure, such as when checking the the default completion settings for a mod type.
3807
     */
3807
     */
3808
    public function test_mod_forum_completion_get_active_rule_descriptions() {
3808
    public function test_mod_forum_completion_get_active_rule_descriptions(): void {
3809
        $this->resetAfterTest();
3809
        $this->resetAfterTest();
3810
        $this->setAdminUser();
3810
        $this->setAdminUser();
Línea 3811... Línea 3811...
3811
 
3811
 
3812
        // Two activities, both with automatic completion. One has the 'completionsubmit' rule, one doesn't.
3812
        // Two activities, both with automatic completion. One has the 'completionsubmit' rule, one doesn't.
Línea 3851... Línea 3851...
3851
    }
3851
    }
Línea 3852... Línea 3852...
3852
 
3852
 
3853
    /**
3853
    /**
3854
     * Test the forum_post_is_visible_privately function used in private replies.
3854
     * Test the forum_post_is_visible_privately function used in private replies.
3855
     */
3855
     */
3856
    public function test_forum_post_is_visible_privately() {
3856
    public function test_forum_post_is_visible_privately(): void {
Línea 3857... Línea 3857...
3857
        $this->resetAfterTest();
3857
        $this->resetAfterTest();
3858
 
3858
 
3859
        $course = $this->getDataGenerator()->create_course();
3859
        $course = $this->getDataGenerator()->create_course();
Línea 3896... Línea 3896...
3896
    }
3896
    }
Línea 3897... Línea 3897...
3897
 
3897
 
3898
    /**
3898
    /**
3899
     * An unkown event type should not have any limits
3899
     * An unkown event type should not have any limits
3900
     */
3900
     */
3901
    public function test_mod_forum_core_calendar_get_valid_event_timestart_range_unknown_event() {
3901
    public function test_mod_forum_core_calendar_get_valid_event_timestart_range_unknown_event(): void {
3902
        global $CFG;
3902
        global $CFG;
Línea 3903... Línea 3903...
3903
        require_once($CFG->dirroot . "/calendar/lib.php");
3903
        require_once($CFG->dirroot . "/calendar/lib.php");
3904
 
3904
 
Línea 3932... Línea 3932...
3932
    }
3932
    }
Línea 3933... Línea 3933...
3933
 
3933
 
3934
    /**
3934
    /**
3935
     * Forums configured without a cutoff date should not have any limits applied.
3935
     * Forums configured without a cutoff date should not have any limits applied.
3936
     */
3936
     */
3937
    public function test_mod_forum_core_calendar_get_valid_event_timestart_range_due_no_limit() {
3937
    public function test_mod_forum_core_calendar_get_valid_event_timestart_range_due_no_limit(): void {
3938
        global $CFG;
3938
        global $CFG;
Línea 3939... Línea 3939...
3939
        require_once($CFG->dirroot . '/calendar/lib.php');
3939
        require_once($CFG->dirroot . '/calendar/lib.php');
3940
 
3940
 
Línea 3968... Línea 3968...
3968
    }
3968
    }
Línea 3969... Línea 3969...
3969
 
3969
 
3970
    /**
3970
    /**
3971
     * Forums should be top bound by the cutoff date.
3971
     * Forums should be top bound by the cutoff date.
3972
     */
3972
     */
3973
    public function test_mod_forum_core_calendar_get_valid_event_timestart_range_due_with_limits() {
3973
    public function test_mod_forum_core_calendar_get_valid_event_timestart_range_due_with_limits(): void {
3974
        global $CFG;
3974
        global $CFG;
Línea 3975... Línea 3975...
3975
        require_once($CFG->dirroot . '/calendar/lib.php');
3975
        require_once($CFG->dirroot . '/calendar/lib.php');
3976
 
3976
 
Línea 4007... Línea 4007...
4007
    }
4007
    }
Línea 4008... Línea 4008...
4008
 
4008
 
4009
    /**
4009
    /**
4010
     * An unknown event type should not change the forum instance.
4010
     * An unknown event type should not change the forum instance.
4011
     */
4011
     */
4012
    public function test_mod_forum_core_calendar_event_timestart_updated_unknown_event() {
4012
    public function test_mod_forum_core_calendar_event_timestart_updated_unknown_event(): void {
4013
        global $CFG, $DB;
4013
        global $CFG, $DB;
Línea 4014... Línea 4014...
4014
        require_once($CFG->dirroot . "/calendar/lib.php");
4014
        require_once($CFG->dirroot . "/calendar/lib.php");
4015
 
4015
 
Línea 4049... Línea 4049...
4049
    }
4049
    }
Línea 4050... Línea 4050...
4050
 
4050
 
4051
    /**
4051
    /**
4052
     * Due date events should update the forum due date.
4052
     * Due date events should update the forum due date.
4053
     */
4053
     */
4054
    public function test_mod_forum_core_calendar_event_timestart_updated_due_event() {
4054
    public function test_mod_forum_core_calendar_event_timestart_updated_due_event(): void {
4055
        global $CFG, $DB;
4055
        global $CFG, $DB;
Línea 4056... Línea 4056...
4056
        require_once($CFG->dirroot . "/calendar/lib.php");
4056
        require_once($CFG->dirroot . "/calendar/lib.php");
4057
 
4057
 
Línea 4092... Línea 4092...
4092
    }
4092
    }
Línea 4093... Línea 4093...
4093
 
4093
 
4094
    /**
4094
    /**
4095
     * Test forum_get_layout_modes function.
4095
     * Test forum_get_layout_modes function.
4096
     */
4096
     */
4097
    public function test_forum_get_layout_modes() {
4097
    public function test_forum_get_layout_modes(): void {
4098
        $expectednormal = [
4098
        $expectednormal = [
4099
            FORUM_MODE_FLATOLDEST => get_string('modeflatoldestfirst', 'forum'),
4099
            FORUM_MODE_FLATOLDEST => get_string('modeflatoldestfirst', 'forum'),
4100
            FORUM_MODE_FLATNEWEST => get_string('modeflatnewestfirst', 'forum'),
4100
            FORUM_MODE_FLATNEWEST => get_string('modeflatnewestfirst', 'forum'),
4101
            FORUM_MODE_THREADED   => get_string('modethreaded', 'forum'),
4101
            FORUM_MODE_THREADED   => get_string('modethreaded', 'forum'),
Línea 4130... Línea 4130...
4130
     *
4130
     *
4131
     * @dataProvider forum_check_throttling_early_returns_provider
4131
     * @dataProvider forum_check_throttling_early_returns_provider
4132
     * @covers ::forum_check_throttling
4132
     * @covers ::forum_check_throttling
4133
     * @param \stdClass $forum The forum data.
4133
     * @param \stdClass $forum The forum data.
4134
     */
4134
     */
4135
    public function test_forum_check_throttling_early_returns(\stdClass $forum) {
4135
    public function test_forum_check_throttling_early_returns(\stdClass $forum): void {
4136
        $this->assertFalse(forum_check_throttling($forum));
4136
        $this->assertFalse(forum_check_throttling($forum));
4137
    }
4137
    }
Línea 4138... Línea 4138...
4138
 
4138
 
4139
    /**
4139
    /**
Línea 4154... Línea 4154...
4154
     *
4154
     *
4155
     * @dataProvider forum_check_throttling_early_exceptions_provider
4155
     * @dataProvider forum_check_throttling_early_exceptions_provider
4156
     * @covers ::forum_check_throttling
4156
     * @covers ::forum_check_throttling
4157
     * @param mixed $forum The forum data.
4157
     * @param mixed $forum The forum data.
4158
     */
4158
     */
4159
    public function test_forum_check_throttling_early_exceptions($forum) {
4159
    public function test_forum_check_throttling_early_exceptions($forum): void {
4160
        $this->expectException(\coding_exception::class);
4160
        $this->expectException(\coding_exception::class);
4161
        $this->assertFalse(forum_check_throttling($forum));
4161
        $this->assertFalse(forum_check_throttling($forum));
4162
    }
4162
    }
Línea 4163... Línea 4163...
4163
 
4163
 
4164
    /**
4164
    /**
4165
     * Tests forum_check_throttling when a non-existent numeric ID is passed for its forum parameter.
4165
     * Tests forum_check_throttling when a non-existent numeric ID is passed for its forum parameter.
4166
     *
4166
     *
4167
     * @covers ::forum_check_throttling
4167
     * @covers ::forum_check_throttling
4168
     */
4168
     */
4169
    public function test_forum_check_throttling_nonexistent_numeric_id() {
4169
    public function test_forum_check_throttling_nonexistent_numeric_id(): void {
Línea 4170... Línea 4170...
4170
        $this->resetAfterTest();
4170
        $this->resetAfterTest();
4171
 
4171
 
4172
        $this->expectException(\moodle_exception::class);
4172
        $this->expectException(\moodle_exception::class);
Línea 4176... Línea 4176...
4176
    /**
4176
    /**
4177
     * Tests forum_check_throttling when a non-existent forum record is passed for its forum parameter.
4177
     * Tests forum_check_throttling when a non-existent forum record is passed for its forum parameter.
4178
     *
4178
     *
4179
     * @covers ::forum_check_throttling
4179
     * @covers ::forum_check_throttling
4180
     */
4180
     */
4181
    public function test_forum_check_throttling_nonexistent_forum_cm() {
4181
    public function test_forum_check_throttling_nonexistent_forum_cm(): void {
4182
        $this->resetAfterTest();
4182
        $this->resetAfterTest();
Línea 4183... Línea 4183...
4183
 
4183
 
4184
        $dummyforum = (object)[
4184
        $dummyforum = (object)[
4185
            'id' => 1,
4185
            'id' => 1,
Línea 4194... Línea 4194...
4194
    /**
4194
    /**
4195
     * Tests forum_check_throttling when a user with the 'mod/forum:postwithoutthrottling' capability.
4195
     * Tests forum_check_throttling when a user with the 'mod/forum:postwithoutthrottling' capability.
4196
     *
4196
     *
4197
     * @covers ::forum_check_throttling
4197
     * @covers ::forum_check_throttling
4198
     */
4198
     */
4199
    public function test_forum_check_throttling_teacher() {
4199
    public function test_forum_check_throttling_teacher(): void {
4200
        $this->resetAfterTest();
4200
        $this->resetAfterTest();
Línea 4201... Línea 4201...
4201
 
4201
 
4202
        $generator = $this->getDataGenerator();
4202
        $generator = $this->getDataGenerator();
4203
        $course = $generator->create_course();
4203
        $course = $generator->create_course();
Línea 4236... Línea 4236...
4236
    /**
4236
    /**
4237
     * Tests forum_check_throttling for students.
4237
     * Tests forum_check_throttling for students.
4238
     *
4238
     *
4239
     * @covers ::forum_check_throttling
4239
     * @covers ::forum_check_throttling
4240
     */
4240
     */
4241
    public function test_forum_check_throttling_student() {
4241
    public function test_forum_check_throttling_student(): void {
4242
        $this->resetAfterTest();
4242
        $this->resetAfterTest();
Línea 4243... Línea 4243...
4243
 
4243
 
4244
        $generator = $this->getDataGenerator();
4244
        $generator = $this->getDataGenerator();
4245
        $course = $generator->create_course();
4245
        $course = $generator->create_course();