Esempio n. 1
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\Notification::deprecate("\$scenario->{$call}() is deprecated in favor of annotation: // @{$call}", $this->scenario->getFeature());
             eval($line);
         }
     }
 }
Esempio n. 2
0
 public function __call($method, $args)
 {
     // all methods were deprecated and removed from here
     Notification::deprecate("\$scenario->{$method}() was deprecated in 2.1 and removed. Don't use it");
 }
Esempio n. 3
0
 public function _initialize()
 {
     Notification::deprecate("Module Dbh is deprecated and will be removed in 2.2");
 }
Esempio n. 4
0
 private function handleDeprecationError($type, $message, $file, $line, $context)
 {
     if (!($this->errorLevel & $type)) {
         return;
     }
     if ($this->deprecationsInstalled && $this->oldHandler) {
         call_user_func($this->oldHandler, $type, $message, $file, $line, $context);
         return;
     }
     Notification::deprecate("{$message}", "{$file}:{$line}");
 }
Esempio n. 5
0
 public function running()
 {
     \Codeception\Lib\Notification::deprecate("Scenario is always running. Please remove \$scenario->running() call.", $this->getFeature());
     return true;
 }