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.
This commit is contained in:
David Monllao
2017-03-31 01:44:21 +02:00
parent 216ea39be7
commit 1535cd5bad
+3 -3
View File
@@ -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);