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

This commit is contained in:
Jun Pataleta 2023-01-09 15:41:27 +08:00
parent 6a7668e350
commit 934d8a2866

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')));