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; }
public function __call($method, $arguments) { if ($this->scenario->running()) { $class = get_class($this); throw new \RuntimeException("Call to undefined method {$class}::{$method}"); } else { $this->scenario->action($method, $arguments); } }