MDL-55986 behat: all options are not valid for single run

Sanitize options which are valid for single run only
This commit is contained in:
Rajesh Taneja 2016-10-05 09:39:26 +08:00
parent 2a864ee9a8
commit b9b474182a
No known key found for this signature in database
GPG Key ID: B363F7FB787F80E4

View File

@ -91,12 +91,20 @@ $commandoptions = "";
// If parallel run then use utilparallel.
if ($options['parallel'] && $options['parallel'] > 1) {
$utilfile = 'util.php';
}
// Sanitize all input options, so they can be passed to util.
foreach ($options as $option => $value) {
if ($value) {
$commandoptions .= " --$option='$value'";
}
}
} else {
// Only sanitize options for single run.
$cmdoptionsforsinglerun = array('run-with-theme');
// Sanitize input options, so they can be passed to util.
foreach ($options as $option => $value) {
if ($value) {
$commandoptions .= " --$option='$value'";
foreach ($cmdoptionsforsinglerun as $option) {
if (!empty($options[$option])) {
$commandoptions .= " --$option='$options[$option]'";
}
}
}