/** * @param TestResult $result * @param $resultCode * * @return Step */ protected function createStep(TestResult $result, $resultCode) { $step = new Step(); $step->setResult($result); $step->setResultCode($resultCode); return $step; }
/** * @param BehatEvent\AfterStepTested $event */ public function onAfterStepTested(BehatEvent\StepTested $event) { $this->timer->stop(); $result = $event->getTestResult(); $step = new Node\Step(); $step->setKeyword($event->getStep()->getKeyword()); $step->setName($event->getStep()->getText()); $step->setLine($event->getStep()->getLine()); $step->setArguments($event->getStep()->getArguments()); $step->setResult($result); $step->setResultCode($result->getResultCode()); $step->setDuration($this->timer->getSeconds()); $this->processStep($step, $result); $this->currentScenario->addStep($step); }