MDL-76597 mod_quiz: Add a default heading name for Behat tests

This commit is contained in:
Jun Pataleta
2023-01-09 15:42:57 +08:00
parent 4d64b0b5fe
commit a61a86c61d
+4
View File
@@ -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')));