/**
  * {@inheritdoc}
  */
 public function tearDown(Environment $env, SpecificationIterator $iterator, $skip, TestResult $result)
 {
     $event = new BeforeSuiteTeardown($env, $iterator, $result);
     $this->eventDispatcher->dispatch($event::BEFORE_TEARDOWN, $event);
     $teardown = $this->baseTester->tearDown($env, $iterator, $skip, $result);
     $event = new AfterSuiteTested($env, $iterator, $result, $teardown);
     $this->eventDispatcher->dispatch($event::AFTER, $event);
     return $teardown;
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function tearDown(Environment $env, SpecificationIterator $iterator, $skip, TestResult $result)
 {
     $teardown = $this->baseTester->tearDown($env, $iterator, $skip, $result);
     if ($skip) {
         return $teardown;
     }
     $scope = new AfterSuiteScope($env, $iterator, $result);
     $hookCallResults = $this->hookDispatcher->dispatchScopeHooks($scope);
     return new HookedTeardown($teardown, $hookCallResults);
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function test(array $iterators, $skip = false)
 {
     $results = array();
     foreach (GroupedSpecificationIterator::group($iterators) as $iterator) {
         $environment = $this->envManager->buildEnvironment($iterator->getSuite());
         $setup = $this->suiteTester->setUp($environment, $iterator, $skip);
         $localSkip = !$setup->isSuccessful() || $skip;
         $testResult = $this->suiteTester->test($environment, $iterator, $localSkip);
         $teardown = $this->suiteTester->tearDown($environment, $iterator, $localSkip, $testResult);
         $integerResult = new IntegerTestResult($testResult->getResultCode());
         $results[] = new TestWithSetupResult($setup, $integerResult, $teardown);
     }
     return new TestResults($results);
 }