/**
  * Adds step to the node.
  *
  * @param StepNode $step Step
  *
  * @throws \LogicException if feature is frozen
  */
 public function addStep(StepNode $step)
 {
     if ($this->isFrozen()) {
         throw new \LogicException('Impossible to change scenario/background steps in frozen feature.');
     }
     $step->setParent($this);
     $this->steps[] = $step;
 }
Beispiel #2
0
 /**
  * Initizalizes step.
  *
  * @param StepNode $simpleStep Initial step
  * @param array    $tokens     Example table row tokens
  */
 public function __construct(StepNode $simpleStep, array $tokens)
 {
     $text = $this->cleanText = $simpleStep->getText();
     foreach ($tokens as $key => $value) {
         $text = str_replace('<' . $key . '>', $value, $text);
     }
     parent::__construct($simpleStep->getType(), $text, $simpleStep->getLine());
     foreach ($simpleStep->getArguments() as $argument) {
         if ($argument instanceof TableNode || $argument instanceof PyStringNode) {
             $this->addArgument($argument->createExampleRowStepArgument($tokens));
         }
     }
     $this->setParent($simpleStep->getParent());
 }
Beispiel #3
0
 /**
  * Adds step to the node.
  *
  * @param   Behat\Gherkin\Node\StepNode $step
  */
 public function addStep(StepNode $step)
 {
     $step->setParent($this);
     $this->steps[] = $step;
 }