Пример #1
0
 public function test()
 {
     $this->makeContexts();
     $description = explode("\n", $this->featureNode->getDescription());
     foreach ($description as $line) {
         $this->getScenario()->runStep(new Comment($line));
     }
     if ($background = $this->featureNode->getBackground()) {
         foreach ($background->getSteps() as $step) {
             $this->runStep($step);
         }
     }
     foreach ($this->scenarioNode->getSteps() as $step) {
         $this->runStep($step);
     }
 }
Пример #2
0
 /**
  * Adds Scenario to Feature
  *
  * @param   Scenario  $scenario Scenario instance
  */
 public function addScenario(ScenarioNode $scenario)
 {
     $scenario->setFeature($this);
     $this->scenarios[] = $scenario;
 }
Пример #3
0
 /**
  * Adds scenario or outline to the feature.
  *
  * @param ScenarioNode $scenario Scenario instance
  *
  * @throws \LogicException if feature is frozen
  */
 public function addScenario(ScenarioNode $scenario)
 {
     if ($this->isFrozen()) {
         throw new \LogicException('Impossible to change frozen feature scenarios.');
     }
     $scenario->setFeature($this);
     $this->scenarios[] = $scenario;
 }
 /**
  * Returns the relative file path for the given step
  *
  * @param StepNode $step
  * @return string
  */
 protected function getFilepath($step)
 {
     return sprintf('%s/%s/%d-%s.png', $this->formatString($this->currentScenario->getFeature()->getTitle()), $this->formatString($this->currentScenario->getTitle()), $this->stepNumber, $this->formatString($step->getText()));
 }