/**
  * Listens to "outline.example.after" event.
  *
  * @param ScenarioEvent $event
  */
 public function afterOutlineExample(OutlineExampleEvent $event)
 {
     if (StepEvent::FAILED === $event->getResult()) {
         $outline = $event->getOutline();
         $examples = $outline->getExamples();
         $lines = $examples->getRowLines();
         $this->writeln($outline->getFile() . ':' . $lines[$event->getIteration() + 1]);
     }
 }
Example #2
0
 /**
  * Return recorded events
  *
  * @return array
  */
 public function getEvents()
 {
     $events = $this->getEventRecorder()->rip();
     foreach ($events as $key => $eventTurple) {
         list($name, $event) = $eventTurple;
         if ($event instanceof StepEvent) {
             $event = new StepEvent($event->getStep(), $event->getLogicalParent(), new NullContext(), $event->getResult(), null, $event->getException() ? new WorkerException($event->getException()->getMessage()) : null, $event->getSnippet());
         }
         if ($event instanceof OutlineExampleEvent) {
             $event = new OutlineExampleEvent($event->getOutline(), $event->getIteration(), new NullContext(), $event->getResult(), $event->isSkipped());
         }
         if ($event instanceof ScenarioEvent) {
             $event = new ScenarioEvent($event->getScenario(), new NullContext(), $event->getResult(), $event->isSkipped());
         }
         $event->setDispatcher(new NullEventDispatcher());
         $events[$key] = array($name, $event);
     }
     return $events;
 }
Example #3
0
 /**
  * Listens to "outline.example.after" event.
  *
  * @param OutlineExampleEvent $event
  *
  * @uses printOutlineExampleFooter()
  */
 public function afterOutlineExample(OutlineExampleEvent $event)
 {
     $this->inOutlineExample = false;
     $this->printOutlineExampleFooter($event->getOutline(), $event->getIteration(), $event->getResult(), $event->isSkipped());
 }
Example #4
0
 /**
  * Listens to "outline.example.after" event.
  *
  * @param   Behat\Behat\Event\OutlineExampleEvent   $event
  *
  * @uses    collectScenarioResult()
  */
 public function afterOutlineExample(OutlineExampleEvent $event)
 {
     $this->collectScenarioResult($event->getResult());
 }
Example #5
0
 /**
  * @param ScenarioEvent|OutlineExampleEvent $event
  */
 public function afterScenario($event)
 {
     if (!$this->enabled) {
         return;
     }
     $this->currentReport['result'] = $event->getResult();
     $this->report[] = $this->currentReport;
 }