/**
  * @param AfterOutlineTested $event
  */
 public function onAfterOutlineTested(AfterOutlineTested $event)
 {
     $scenarioPassed = $event->getTestResult()->isPassed();
     if ($scenarioPassed) {
         $this->passedScenarios[] = $this->currentScenario;
         $this->currentFeature->addPassedScenario();
     } else {
         $this->failedScenarios[] = $this->currentScenario;
         $this->currentFeature->addFailedScenario();
     }
     $this->currentScenario->setPassed($event->getTestResult()->isPassed());
     $this->currentFeature->addScenario($this->currentScenario);
     $print = $this->renderer->renderAfterOutline($this);
     $this->printer->writeln($print);
 }
 /**
  * @param AfterScenarioTested $event
  */
 public function onAfterScenarioTested(AfterScenarioTested $event)
 {
     $scenarioPassed = $event->getTestResult()->isPassed();
     if ($scenarioPassed) {
         $this->passedScenarios[] = $this->currentScenario;
         $this->currentFeature->addPassedScenario();
     } else {
         $this->failedScenarios[] = $this->currentScenario;
         $this->currentFeature->addFailedScenario();
     }
     $this->currentScenario->setLoopCount(1);
     $this->currentScenario->setPassed($event->getTestResult()->isPassed());
     $this->currentFeature->addScenario($this->currentScenario);
     $print = $this->renderer->renderAfterScenario($this);
     /*Old logic*/
     /*$this->printer->writeln($print);*/
     /*New logic*/
     //$featureName = $this->getCurrentFeature()->getName();
     $featureName = $this->getCurrentFeature()->getFileName();
     $this->printer->featureWriteln($print, $featureName);
 }