示例#1
0
 public function __call($method, $args)
 {
     // if (!in_array($method, array_keys(TestGuy::$methods))) throw new \RuntimeException("Action $method not defined");
     if (0 === strpos($method, 'see')) {
         $this->scenario->assertion(array_merge(array($method), $args));
     } elseif (0 === strpos($method, 'am')) {
         $this->scenario->condition(array_merge(array($method), $args));
     } else {
         $this->scenario->action(array_merge(array($method), $args));
     }
     return $this;
 }
示例#2
0
 public function testMethod($signature)
 {
     $this->scenario->condition('testMethod', array($signature));
     if ($this->scenario->running()) {
         $this->scenario->runStep();
         return $this;
     }
     if (!$this->scenario->getFeature()) {
         $this->scenario->setFeature("test method {$signature}()");
     } else {
         $this->scenario->setFeature($this->scenario->getFeature() . " with [[{$signature}]]");
     }
     return $this;
 }