diff --git a/mod/quiz/tests/behat/behat_mod_quiz.php b/mod/quiz/tests/behat/behat_mod_quiz.php index 5c2198b057b..850fe53a098 100644 --- a/mod/quiz/tests/behat/behat_mod_quiz.php +++ b/mod/quiz/tests/behat/behat_mod_quiz.php @@ -676,6 +676,10 @@ class behat_mod_quiz extends behat_question_base { * @param string $sectionheading the new heading to set. */ public function i_set_the_section_heading_for($sectionname, $sectionheading) { + // Empty section headings will have a default names of "Untitled heading". + if (empty($sectionname)) { + $sectionname = get_string('sectionnoname', 'quiz'); + } $this->execute('behat_general::click_link', $this->escape("Edit heading '{$sectionname}'")); $this->execute('behat_general::assert_page_contains_text', $this->escape(get_string('edittitleinstructions')));