/** * {@inheritdoc} */ public function setUp(array $iterators, $skip) { $event = new BeforeExerciseCompleted($iterators); $this->eventDispatcher->dispatch($event::BEFORE, $event); $setup = $this->baseExercise->setUp($iterators, $skip); $event = new AfterExerciseSetup($iterators, $setup); $this->eventDispatcher->dispatch($event::AFTER_SETUP, $event); return $setup; }
/** * 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); }
/** * Sets up exercise for a test. * * @param SpecificationIterator[] $iterators * @param Boolean $skip * * @return Setup */ public function setUp(array $iterators, $skip) { return $this->decoratedExercise->setUp($this->order($iterators), $skip); }