示例#1
0
 public function runStep(Step $step)
 {
     $this->steps[] = $step;
     $result = null;
     $this->metadata->getService('dispatcher')->dispatch(Events::STEP_BEFORE, new StepEvent($this->test, $step));
     try {
         $result = $step->run($this->metadata->getService('modules'));
     } catch (ConditionalAssertionFailed $f) {
         $result = $this->test->getTestResultObject();
         $result->addFailure(clone $this->test, $f, $result->time());
     } catch (\Exception $e) {
         $this->metadata->getService('dispatcher')->dispatch(Events::STEP_AFTER, new StepEvent($this->test, $step));
         throw $e;
     }
     $this->metadata->getService('dispatcher')->dispatch(Events::STEP_AFTER, new StepEvent($this->test, $step));
     $step->executed = true;
     return $result;
 }