Exemplo n.º 1
0
 public function wantTo($text)
 {
     if ($this->scenario->running()) {
         $this->scenario->runStep();
         return $this;
     }
     $this->scenario->setFeature(strtolower($text));
     return $this;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
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;
 }
Exemplo n.º 4
0
 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;
     }
 }
Exemplo n.º 5
0
 public function wantTo($text)
 {
     $this->scenario->setFeature(mb_strtolower($text));
 }