/** * {@inheritdoc} */ public function setUp(Environment $env, FeatureNode $feature, Scenario $scenario, $skip) { $event = new BeforeScenarioTested($env, $feature, $scenario); $this->eventDispatcher->dispatch($this->beforeEventName, $event); $setup = $this->baseTester->setUp($env, $feature, $scenario, $skip); $event = new AfterScenarioSetup($env, $feature, $scenario, $setup); $this->eventDispatcher->dispatch($this->afterSetupEventName, $event); return $setup; }
/** * {@inheritdoc} */ public function setUp(Environment $env, FeatureNode $feature, Scenario $scenario, $skip) { $setup = $this->baseTester->setUp($env, $feature, $scenario, $skip); if ($skip) { return $setup; } $scope = new BeforeScenarioScope($env, $feature, $scenario); $hookCallResults = $this->hookDispatcher->dispatchScopeHooks($scope); return new HookedSetup($setup, $hookCallResults); }
/** * {@inheritdoc} */ public function test(Environment $env, FeatureNode $feature, Scenario $scenario, $skip) { $isolatedEnvironment = $this->envManager->isolateEnvironment($env, $scenario); $setup = $this->decoratedTester->setUp($isolatedEnvironment, $feature, $scenario, $skip); $localSkip = !$setup->isSuccessful() || $skip; $testResult = $this->decoratedTester->test($isolatedEnvironment, $feature, $scenario, $localSkip); $teardown = $this->decoratedTester->tearDown($isolatedEnvironment, $feature, $scenario, $localSkip, $testResult); $integerResult = new IntegerTestResult($testResult->getResultCode()); return new TestWithSetupResult($setup, $integerResult, $teardown); }
/** * {@inheritdoc} */ public function test(Environment $env, FeatureNode $feature, OutlineNode $outline, $skip = false) { $results = array(); foreach ($outline->getExamples() as $example) { $setup = $this->scenarioTester->setUp($env, $feature, $example, $skip); $localSkip = !$setup->isSuccessful() || $skip; $testResult = $this->scenarioTester->test($env, $feature, $example, $localSkip); $teardown = $this->scenarioTester->tearDown($env, $feature, $example, $localSkip, $testResult); $integerResult = new IntegerTestResult($testResult->getResultCode()); $results[] = new TestWithSetupResult($setup, $integerResult, $teardown); } return new TestResults($results); }