diff --git a/course/tests/behat/behat_course.php b/course/tests/behat/behat_course.php index 4b20f931a1bd3..52f4354e3678d 100644 --- a/course/tests/behat/behat_course.php +++ b/course/tests/behat/behat_course.php @@ -399,7 +399,7 @@ public function i_edit_the_section($sectionnumber) { // We need to know the course format as the text strings depends on them. $courseformat = $this->get_course_format(); - if (get_string_manager()->string_exists('editsection', $courseformat)) { + if ($sectionnumber > 0 && get_string_manager()->string_exists('editsection', $courseformat)) { $stredit = get_string('editsection', $courseformat); } else { $stredit = get_string('editsection');