Beispiel #1
0
 public function parseScenarioOptions($code)
 {
     $annotations = ['group', 'env', 'skip', 'incomplete', 'ignore'];
     $comments = $this->matchComments($code);
     foreach ($annotations as $annotation) {
         $values = Annotation::fetchAllFromComment($annotation, $comments);
         foreach ($values as $value) {
             call_user_func([$this->scenario, $annotation], $value);
         }
     }
     // deprecated - parsing $scenario->xxx calls
     $metaData = ['group', 'env'];
     $phpCode = $this->stripComments($code);
     $scenario = $this->scenario;
     $feature = $scenario->getFeature();
     foreach ($metaData as $call) {
         $res = preg_match_all("~\\\$scenario->{$call}.*?;~", $phpCode, $matches);
         if (!$res) {
             continue;
         }
         foreach ($matches[0] as $line) {
             // run $scenario->group or $scenario->env
             \Codeception\Lib\Deprecation::add("\$scenario->{$call}() is deprecated in favor of annotation: // @{$call}", $this->scenario->getFeature());
             eval($line);
         }
     }
 }
Beispiel #2
0
 public function parseScenarioOptions($code)
 {
     $comments = $this->matchComments($code);
     $this->attachMetadata($comments);
     // deprecated - parsing $scenario->xxx calls
     $metaData = ['group', 'env'];
     $phpCode = $this->stripComments($code);
     $scenario = $this->scenario;
     $feature = $scenario->getFeature();
     foreach ($metaData as $call) {
         $res = preg_match_all("~\\\$scenario->{$call}.*?;~", $phpCode, $matches);
         if (!$res) {
             continue;
         }
         foreach ($matches[0] as $line) {
             // run $scenario->group or $scenario->env
             \Codeception\Lib\Deprecation::add("\$scenario->{$call}() is deprecated in favor of annotation: // @{$call}", $this->scenario->getFeature());
             eval($line);
         }
     }
 }
Beispiel #3
0
 public function running()
 {
     \Codeception\Lib\Deprecation::add("Scenario is always running. Please remove \$scenario->running() call.", $this->getFeature());
     return true;
 }