/** * {@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); }
/** * @param array $steps * @param Suite $suite * @return \Behat\Behat\Tester\Result\StepResult */ public function run($steps, Suite $suite) { $env = $this->environmentManager->buildEnvironment($suite); $env = $this->environmentManager->isolateEnvironment($env); $dummyFeatureNode = $this->generator->generate($steps); $featureNode = $dummyFeatureNode->getFeatureNode(); foreach ($dummyFeatureNode->getStepNodes() as $stepNode) { $this->stepTester->setUp($env, $featureNode, $stepNode, false); $result = $this->stepTester->test($env, $featureNode, $stepNode, false); $this->stepTester->tearDown($env, $featureNode, $stepNode, false, $result); } return $result; }
/** * {@inheritdoc} */ public function test(Environment $env, $feature, $skip = false) { $results = array(); foreach ($feature->getScenarios() as $scenario) { $isolatedEnvironment = $this->envManager->isolateEnvironment($env, $scenario); $tester = $scenario instanceof OutlineNode ? $this->outlineTester : $this->scenarioTester; $setup = $tester->setUp($isolatedEnvironment, $feature, $scenario, $skip); $localSkip = !$setup->isSuccessful() || $skip; $testResult = $tester->test($isolatedEnvironment, $feature, $scenario, $localSkip); $teardown = $tester->tearDown($isolatedEnvironment, $feature, $scenario, $localSkip, $testResult); $integerResult = new IntegerTestResult($testResult->getResultCode()); $results[] = new TestWithSetupResult($setup, $integerResult, $teardown); } return new TestResults($results); }
public function test(Environment $env, $feature, $skip) { $results = array(); foreach ($feature->getScenarios() as $scenario) { $isolatedEnvironment = $this->envManager->isolateEnvironment($env, $scenario); $block = new AroundHookScenarioBlock($scenario, $isolatedEnvironment, $feature, $skip, $this->scenarioTester, $this->outlineTester, $this->envManager); $scope = new AroundScenarioScope($isolatedEnvironment, $feature, $scenario, $block); $hookCallResults = $this->hookDispatcher->dispatchScopeHooks($scope); foreach ($hookCallResults as $callResult) { echo $callResult->getStdOut(); if ($callResult->hasException()) { throw $callResult->getException(); } } if (count($hookCallResults) == 0) { $block->call(); } $results = array_merge($results, $block->getResults()); } return new TestResults($results); }