/**
  * {@inheritdoc}
  */
 public function tearDown(array $iterators, $skip, TestResult $result)
 {
     $event = new BeforeExerciseTeardown($iterators, $result);
     $this->eventDispatcher->dispatch($event::BEFORE_TEARDOWN, $event);
     $teardown = $this->baseExercise->tearDown($iterators, $skip, $result);
     $event = new AfterExerciseCompleted($iterators, $result, $teardown);
     $this->eventDispatcher->dispatch($event::AFTER, $event);
     return $teardown;
 }
 /**
  * Tests exercise specifications.
  *
  * @param InputInterface          $input
  * @param SpecificationIterator[] $specifications
  *
  * @return TestResult
  */
 private function testSpecifications(InputInterface $input, array $specifications)
 {
     $skip = $input->getOption('dry-run') || $this->skip;
     $setup = $this->exercise->setUp($specifications, $skip);
     $skip = !$setup->isSuccessful() || $skip;
     $testResult = $this->exercise->test($specifications, $skip);
     $teardown = $this->exercise->tearDown($specifications, $skip, $testResult);
     $result = new IntegerTestResult($testResult->getResultCode());
     return new TestWithSetupResult($setup, $result, $teardown);
 }
Beispiel #3
0
 /**
  * Tears down exercise after a test.
  *
  * @param SpecificationIterator[] $iterators
  * @param Boolean $skip
  * @param TestResult $result
  *
  * @return Teardown
  */
 public function tearDown(array $iterators, $skip, TestResult $result)
 {
     return $this->decoratedExercise->tearDown($this->order($iterators), $skip, $result);
 }