Skip to content

Commit

Permalink
MDL-76597 mod_quiz: Add a default heading name for Behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Jan 9, 2023
1 parent 08a2781 commit 7927374
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mod/quiz/tests/behat/behat_mod_quiz.php
Expand Up @@ -691,6 +691,10 @@ public function i_delete_question_by_clicking_the_delete_icon($questionname) {
* @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')));
Expand Down

0 comments on commit 7927374

Please sign in to comment.