MDL-62514 behat: Remove potentially conflicting names from description
authorAndrew Nicols <andrew@nicols.co.uk>
Wed, 9 Jan 2019 06:42:13 +0000 (14:42 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 30 Jan 2019 00:24:32 +0000 (08:24 +0800)
lib/testing/generator/data_generator.php
lib/testing/tests/generator_test.php

index 977e783..24a944a 100644 (file)
@@ -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'])) {
index 33bdd99..d22a910 100644 (file)
@@ -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);