diff --git a/lib/testing/generator/data_generator.php b/lib/testing/generator/data_generator.php index 977e78382c6..24a944a99d1 100644 --- a/lib/testing/generator/data_generator.php +++ b/lib/testing/generator/data_generator.php @@ -340,7 +340,7 @@ EOD; } if (!isset($record['description'])) { - $record['description'] = "Test cohort $i\n$this->loremipsum"; + $record['description'] = "Description for '{$record['name']}' \n$this->loremipsum"; } if (!isset($record['descriptionformat'])) { diff --git a/lib/testing/tests/generator_test.php b/lib/testing/tests/generator_test.php index 33bdd99dfa1..d22a9101a4a 100644 --- a/lib/testing/tests/generator_test.php +++ b/lib/testing/tests/generator_test.php @@ -156,7 +156,7 @@ class core_test_generator_testcase extends advanced_testcase { $this->assertEquals(context_system::instance()->id, $cohort->contextid); $this->assertRegExp('/^Cohort \d/', $cohort->name); $this->assertSame('', $cohort->idnumber); - $this->assertRegExp('/^Test cohort \d/', $cohort->description); + $this->assertRegExp("/^Description for '{$cohort->name}' \\n/", $cohort->description); $this->assertSame(FORMAT_MOODLE, $cohort->descriptionformat); $this->assertSame('', $cohort->component); $this->assertLessThanOrEqual(time(), $cohort->timecreated);