Example #1
0
 /**
  * Captures hook stats on hooked event.
  *
  * @param Event $event
  */
 private function captureHookStatsOnEvent(Event $event)
 {
     if ($event instanceof AfterSetup && $event->getSetup() instanceof HookedSetup) {
         $this->captureBeforeHookStats($event->getSetup());
     }
     if ($event instanceof AfterTested && $event->getTeardown() instanceof HookedTeardown) {
         $this->captureAfterHookStats($event->getTeardown());
     }
 }
Example #2
0
 /**
  * Prints feature header on BEFORE event.
  *
  * @param Formatter $formatter
  * @param Event     $event
  */
 private function printHeaderOnBeforeEvent(Formatter $formatter, Event $event)
 {
     if (!$event instanceof AfterFeatureSetup) {
         return;
     }
     $this->setupPrinter->printSetup($formatter, $event->getSetup());
     $this->featurePrinter->printHeader($formatter, $event->getFeature());
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function listenEvent(Formatter $formatter, Event $event, $eventName)
 {
     if ($event instanceof AfterSuiteSetup) {
         $this->setupPrinter->printSetup($formatter, $event->getSetup());
     }
     if ($event instanceof AfterSuiteTested) {
         $this->setupPrinter->printTeardown($formatter, $event->getTeardown());
     }
 }
Example #4
0
 /**
  * Prints step setup on step BEFORE event.
  *
  * @param Formatter $formatter
  * @param Event     $event
  */
 private function printStepSetupOnBeforeStepEvent(Formatter $formatter, Event $event)
 {
     if (!$event instanceof AfterStepSetup) {
         return;
     }
     $this->stepSetupPrinter->printSetup($formatter, $event->getSetup());
 }
 /**
  * Captures example setup on example BEFORE event.
  *
  * @param Event $event
  */
 private function captureExampleSetupOnBeforeEvent(Event $event)
 {
     if (!$event instanceof AfterScenarioSetup) {
         return;
     }
     $this->exampleSetup = $event->getSetup();
 }