run() public method

Executes this node.
public run ( ) : Node
return Node
Ejemplo n.º 1
0
 /**
  * (non-PHPdoc)
  * @see PAGI\Node.Node::run()
  */
 public function run()
 {
     $result = parent::run();
     foreach ($this->expectedSay as $semiHash => $times) {
         $data = unserialize($semiHash);
         $what = array_shift($data);
         $arguments = array_shift($data);
         $doneTimes = 0;
         if (isset($this->doneSay[$semiHash])) {
             $doneTimes = $this->doneSay[$semiHash];
         }
         if ($times != $doneTimes) {
             throw new MockedException("{$what} (" . implode(",", $arguments) . ") expected to be" . " called {$times} times, was called {$doneTimes} times");
         }
     }
     if ($this->expectedState != Node::STATE_NOT_RUN) {
         if ($this->expectedState != $this->state) {
             throw new MockedException("Expected state: " . parent::stateToString($this->expectedState) . " vs. Current: " . parent::stateToString($this->state));
         }
     }
     return $result;
 }