MDL-70412 groups: Improving create_group data generator
authorAmaia Anabitarte <amaia@moodle.com>
Thu, 26 Nov 2020 08:29:43 +0000 (09:29 +0100)
committerAmaia Anabitarte <amaia@moodle.com>
Thu, 15 Apr 2021 14:57:23 +0000 (16:57 +0200)
Increasing the size of the name for generated groups
to ensure we don't have problems with ordering.

lib/testing/generator/data_generator.php

index b655ff4..29c8168 100644 (file)
@@ -509,7 +509,7 @@ EOD;
         require_once($CFG->dirroot . '/group/lib.php');
 
         $this->groupcount++;
-        $i = $this->groupcount;
+        $i = str_pad($this->groupcount, 4, '0', STR_PAD_LEFT);
 
         $record = (array)$record;