mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
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:
parent
2a864ee9a8
commit
b9b474182a
@ -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]'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user