From 934d8a28662c1ea7491468e4ce136edc616bcacc Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Mon, 9 Jan 2023 15:41:27 +0800 Subject: [PATCH] MDL-76597 mod_quiz: Add a default heading name for Behat tests --- mod/quiz/tests/behat/behat_mod_quiz.php | 4 ++++ 1 file changed, 4 insertions(+) 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'))); -- 2.11.4.GIT