getRoot() public method

public getRoot ( )
Beispiel #1
0
 /**
  * @return Step
  */
 public function add(Scenario $scenario)
 {
     if (!($step = $scenario->getRoot())) {
         throw new LogicException('Unable to add an empty scenario.');
     }
     $options = $this->root->getOptions();
     $this->root = clone $scenario->getRoot();
     $this->root->setOptions($options);
     return $this->root;
 }
Beispiel #2
0
 public function add(Scenario $scenario)
 {
     if (!($step = $scenario->getRoot())) {
         throw new LogicException('Unable to add an empty scenario.');
     }
     if ($this->root) {
         throw new LogicException('Unable to add a scenario at the root step.');
     }
     $this->next = clone $scenario->getRoot();
     $this->next->root = false;
     $this->next->options = $this->options;
     return $this->next->getLast();
 }