public function FeatureContext::transformLocalConf in Bear 8
Same name and namespace in other branches
- 8.2 tests/features/bootstrap/FeatureContext.php \FeatureContext::transformLocalConf()
- 7.2 tests/features/bootstrap/FeatureContext.php \FeatureContext::transformLocalConf()
- 7 tests/features/bootstrap/FeatureContext.php \FeatureContext::transformLocalConf()
@Transform /\[.*\](?:.*)/
File
- tests/
features/ bootstrap/ FeatureContext.php, line 51
Class
- FeatureContext
- Defines application features from the specific context.
Code
public function transformLocalConf($argument) {
// Token replace the argument.
preg_match('/\\[(.*)\\]/', $argument, $matches);
$token = $matches[1];
if (isset($this->localConf[$token])) {
// throw new \Exception(sprintf('Argument %s and token %s and result %s', $argument, $token, str_replace('[' . $token . ']', $this->localConf[$token], $argument)));
return str_replace('[' . $token . ']', $this->localConf[$token], $argument);
}
}