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); } }
/** * Adds Scenario to Feature * * @param Scenario $scenario Scenario instance */ public function addScenario(ScenarioNode $scenario) { $scenario->setFeature($this); $this->scenarios[] = $scenario; }
/** * 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())); }