Skip to content

Commit

Permalink
Merge branch 'MDL-70732-master' of git://github.com/aanabit/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Feb 10, 2021
2 parents 3b15de8 + 248d4ff commit fd31854
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions course/tests/behat/behat_course.php
Expand Up @@ -1360,7 +1360,8 @@ protected function get_category_id($idnumber) {
try {
return $DB->get_field('course_categories', 'id', array('idnumber' => $idnumber), MUST_EXIST);
} catch (dml_missing_record_exception $ex) {
throw new ExpectationException(sprintf("There is no category in the database with the idnumber '%s'", $idnumber));
throw new ExpectationException(sprintf("There is no category in the database with the idnumber '%s'", $idnumber),
$this->getSession());
}
}

Expand All @@ -1378,7 +1379,8 @@ protected function get_course_id($idnumber) {
try {
return $DB->get_field('course', 'id', array('idnumber' => $idnumber), MUST_EXIST);
} catch (dml_missing_record_exception $ex) {
throw new ExpectationException(sprintf("There is no course in the database with the idnumber '%s'", $idnumber));
throw new ExpectationException(sprintf("There is no course in the database with the idnumber '%s'", $idnumber),
$this->getSession());
}
}

Expand Down
5 changes: 3 additions & 2 deletions lib/tests/behat/behat_general.php
Expand Up @@ -1575,7 +1575,7 @@ public function the_image_at_should_be_identical_to($element, $selectortype, $fi

if ($content !== $expectedcontent) {
throw new ExpectationException('Image is not identical to the fixture. Received ' .
strlen($content) . ' bytes and expected ' . strlen($expectedcontent) . ' bytes');
strlen($content) . ' bytes and expected ' . strlen($expectedcontent) . ' bytes', $this->getSession());
}
}

Expand Down Expand Up @@ -1860,7 +1860,8 @@ public function i_press_key_in_element($key, $element, $selectortype) {
list($modifier, $char) = preg_split('/-/', $key, 2);
$modifier = strtolower($modifier);
if (!in_array($modifier, $validmodifiers)) {
throw new ExpectationException(sprintf('Unknown key modifier: %s.', $modifier));
throw new ExpectationException(sprintf('Unknown key modifier: %s.', $modifier),
$this->getSession());
}
}
if (is_numeric($char)) {
Expand Down
3 changes: 2 additions & 1 deletion mod/quiz/tests/behat/behat_mod_quiz.php
Expand Up @@ -417,7 +417,8 @@ public function i_open_the_add_to_quiz_menu_for($pageorlast) {
} else if (preg_match('~Page (\d+)~', $pageorlast, $matches)) {
$xpath = "//li[@id = 'page-{$matches[1]}']//a[contains(@data-toggle, 'dropdown') and contains(., 'Add')]";
} else {
throw new ExpectationException("The I open the add to quiz menu step must specify either 'Page N' or 'last'.");
throw new ExpectationException("The I open the add to quiz menu step must specify either 'Page N' or 'last'.",
$this->getSession());
}
$this->find('xpath', $xpath)->click();
}
Expand Down

0 comments on commit fd31854

Please sign in to comment.