MDL-46891 behat: Allow replacing string in profile for parallel run

Adding a replace with run process in profile
should be allowed
This commit is contained in:
Rajesh Taneja 2016-03-17 12:20:22 +08:00
parent 0758e02e84
commit 8c66773dac

View File

@ -120,10 +120,14 @@ $tags = '';
if ($options['profile']) {
$profile = $options['profile'];
if (!isset($CFG->behat_config[$profile]) && !isset($CFG->behat_profiles[$profile])) {
// If profile passed is not set, then exit.
if (!isset($CFG->behat_config[$profile]) && !isset($CFG->behat_profiles[$profile]) &&
!(isset($options['replace']) && (strpos($options['profile'], $options['replace']) >= 0 ))) {
echo "Invalid profile passed: " . $profile . PHP_EOL;
exit(1);
}
$extraopts[] = '--profile="' . $profile . '"';
// By default, profile tags will be used.
if (!empty($CFG->behat_config[$profile]['filters']['tags'])) {