コード例 #1
0
ファイル: Parser.php プロジェクト: RobertWang/Codeception
 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);
         }
     }
 }
コード例 #2
0
ファイル: Parser.php プロジェクト: Dossar/boltbse
 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);
         }
     }
 }
コード例 #3
0
ファイル: Scenario.php プロジェクト: corcre/elabftw
 public function running()
 {
     \Codeception\Lib\Deprecation::add("Scenario is always running. Please remove \$scenario->running() call.", $this->getFeature());
     return true;
 }
コード例 #4
0
ファイル: Console.php プロジェクト: corcre/elabftw
 public function afterSuite(SuiteEvent $e)
 {
     $this->message()->width(array_sum($this->columns), '-')->writeln();
     $deprecationMessages = Deprecation::all();
     foreach ($deprecationMessages as $message) {
         $this->output->deprecate($message);
     }
 }