/**
  * @param  AfterTested $event
  *
  * @return boolean
  */
 private function shouldTakeScreenshot(AfterTested $event)
 {
     $isStepFailed = $event->getTestResult()->getResultCode() == TestResult::FAILED;
     $isStepSkipped = $event->getTestResult()->getResultCode() == TestResult::SKIPPED;
     $shouldRecordAllSteps = $this->config->shouldRecordAllSteps();
     return $isStepFailed || !$isStepSkipped && $shouldRecordAllSteps;
 }
 function it_does_not_take_a_screenshot_after_a_passed_step_if_not_enabled(Config $config, ScreenshotTaker $screenshotTaker, Environment $env, FeatureNode $feature, StepNode $step, StepResult $result, Teardown $tearDown)
 {
     $event = new AfterStepTested($env->getWrappedObject(), $feature->getWrappedObject(), $step->getWrappedObject(), $result->getWrappedObject(), $tearDown->getWrappedObject());
     $config->shouldRecordAllSteps()->willReturn(false);
     $result->getResultCode()->willReturn(TestResult::PASSED);
     $screenshotTaker->takeScreenshot()->shouldNotBeCalled();
     $this->takeScreenshot($event);
 }