getRoot() 공개 메소드

public getRoot ( )
예제 #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;
 }
예제 #2
0
파일: Step.php 프로젝트: blackfireio/player
 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();
 }