Exemplo n.º 1
0
 /**
  * @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;
 }
Exemplo n.º 2
0
 /**
  * Tests container.
  *
  * @param Environment            $env
  * @param FeatureNode            $feature
  * @param StepContainerInterface $container
  * @param Boolean                $skip
  *
  * @return TestResult[]
  */
 public function test(Environment $env, FeatureNode $feature, StepContainerInterface $container, $skip)
 {
     $results = array();
     foreach ($container->getSteps() as $step) {
         $setup = $this->stepTester->setUp($env, $feature, $step, $skip);
         $skipSetup = !$setup->isSuccessful() || $skip;
         $testResult = $this->stepTester->test($env, $feature, $step, $skipSetup);
         $skip = !$testResult->isPassed() || $skip;
         $teardown = $this->stepTester->tearDown($env, $feature, $step, $skipSetup, $testResult);
         $skip = $skip || $skipSetup || !$teardown->isSuccessful();
         $integerResult = new IntegerTestResult($testResult->getResultCode());
         $results[] = new TestWithSetupResult($setup, $integerResult, $teardown);
     }
     return $results;
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function test(Environment $env, FeatureNode $feature, StepNode $step, $skip)
 {
     declare (ticks=1);
     return $this->baseTester->test($env, $feature, $step, $skip);
 }