From 1535cd5bade30d71575110fbd32bfa68192c6bb9 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Fri, 31 Mar 2017 01:43:43 +0200 Subject: [PATCH] MDL-58450 mod_forum: Force groups to be returned as they are created Long history resumed: The test relies on the first group being the first that is created, the first group is actually the first one ordering by name. If is group-999 and is group-1000 is returned as the first group. --- mod/forum/tests/lib_test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/forum/tests/lib_test.php b/mod/forum/tests/lib_test.php index 82c5ffbf57a..72c1526059a 100644 --- a/mod/forum/tests/lib_test.php +++ b/mod/forum/tests/lib_test.php @@ -2023,9 +2023,9 @@ class mod_forum_lib_testcase extends advanced_testcase { $cm = get_coursemodule_from_instance('forum', $forum->id); // Create groups. - $group1 = self::getDataGenerator()->create_group(array('courseid' => $course->id)); - $group2 = self::getDataGenerator()->create_group(array('courseid' => $course->id)); - $group3 = self::getDataGenerator()->create_group(array('courseid' => $course->id)); + $group1 = self::getDataGenerator()->create_group(array('courseid' => $course->id, 'name' => 'group1')); + $group2 = self::getDataGenerator()->create_group(array('courseid' => $course->id, 'name' => 'group2')); + $group3 = self::getDataGenerator()->create_group(array('courseid' => $course->id, 'name' => 'group3')); // Add the user1 to g1 and g2 groups. groups_add_member($group1->id, $user1->id);