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); } } }
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"); }
public function _initialize() { Notification::deprecate("Module Dbh is deprecated and will be removed in 2.2"); }
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}"); }
public function running() { \Codeception\Lib\Notification::deprecate("Scenario is always running. Please remove \$scenario->running() call.", $this->getFeature()); return true; }