MDL-60078 behat: Convert ErrorException to DriverException

This commit is contained in:
Andrew Nicols 2018-01-22 11:29:29 +08:00
parent 60ce5848f6
commit 0cc0f72ceb

View File

@ -1651,12 +1651,12 @@ class behat_general extends behat_base {
* @param string $not optional step verifier
* @param string $nodeelement Element identifier
* @param string $nodeselectortype Element type
* @throws ErrorException If not using JavaScript
* @throws DriverException If not using JavaScript
* @throws ExpectationException
*/
public function the_focused_element_is($not, $nodeelement, $nodeselectortype) {
if (!$this->running_javascript()) {
throw new ErrorException('Checking focus on an element requires JavaScript');
throw new DriverException('Checking focus on an element requires JavaScript');
}
list($a, $b) = $this->transform_selector($nodeselectortype, $nodeelement);
$element = $this->find($a, $b);
@ -1684,12 +1684,12 @@ class behat_general extends behat_base {
* @param string $selectortype Element type
* @param string $nodeelement Element we look in
* @param string $nodeselectortype The type of selector where we look in
* @throws ErrorException If not using JavaScript
* @throws DriverException If not using JavaScript
* @throws ExpectationException
*/
public function the_focused_element_is_in_the($not, $element, $selectortype, $nodeelement, $nodeselectortype) {
if (!$this->running_javascript()) {
throw new ErrorException('Checking focus on an element requires JavaScript');
throw new DriverException('Checking focus on an element requires JavaScript');
}
$element = $this->get_node_in_container($selectortype, $element, $nodeselectortype, $nodeelement);
$xpath = addslashes_js($element->getXpath());