public function wantTo($text) { if ($this->scenario->running()) { $this->scenario->runStep(); return $this; } $this->scenario->setFeature(strtolower($text)); return $this; }
public function testMethod($signature) { if (!$this->scenario->getFeature()) { $this->scenario->setFeature("test method {$signature}()"); } else { $this->scenario->setFeature($this->scenario->getFeature() . " with [[{$signature}]]"); } $this->scenario->condition(array_merge(array('testMethod', $signature))); return $this; }
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; }
public function parseFeature($code) { $matches = []; $code = $this->stripComments($code); $res = preg_match("~\\\$I->wantTo\\(\\s*?['\"](.*?)['\"]\\s*?\\);~", $code, $matches); if ($res) { $this->scenario->setFeature($matches[1]); return; } $res = preg_match("~\\\$I->wantToTest\\(['\"](.*?)['\"]\\);~", $code, $matches); if ($res) { $this->scenario->setFeature("test " . $matches[1]); return; } }
public function wantTo($text) { $this->scenario->setFeature(mb_strtolower($text)); }