diff --git a/lib/behat/extension/Moodle/BehatExtension/EventDispatcher/Tester/ChainedStepTester.php b/lib/behat/extension/Moodle/BehatExtension/EventDispatcher/Tester/ChainedStepTester.php index e480e001dda..a1b150258f5 100644 --- a/lib/behat/extension/Moodle/BehatExtension/EventDispatcher/Tester/ChainedStepTester.php +++ b/lib/behat/extension/Moodle/BehatExtension/EventDispatcher/Tester/ChainedStepTester.php @@ -125,7 +125,13 @@ class ChainedStepTester implements StepTester { // Extra step, looking for a moodle exception, a debugging() message or a PHP debug message. $checkingStep = new StepNode('Given', self::EXCEPTIONS_STEP_TEXT, array(), $step->getLine()); $afterExceptionCheckingEvent = $this->singlesteptester->test($env, $feature, $checkingStep, $skip); - return $this->checkSkipResult($afterExceptionCheckingEvent); + $exceptionCheckResult = $this->checkSkipResult($afterExceptionCheckingEvent); + + if (!$exceptionCheckResult->isPassed()) { + return $exceptionCheckResult; + } + + return $result; } return $this->runChainedSteps($env, $feature, $result, $skip);