Skip to content

Commit

Permalink
Fix null handling in test runner when printing env
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi committed Jun 4, 2021
1 parent 1143155 commit c916613
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,7 @@ function run_all_tests_parallel(array $test_files, array $env, $redir_tested): v
'E_USER_NOTICE',
'E_STRICT', // TODO Cleanup when removed from Zend Engine.
'E_RECOVERABLE_ERROR',
'E_DEPRECATED',
'E_USER_DEPRECATED'
];
$error_consts = array_combine(array_map('constant', $error_consts), $error_consts);
Expand Down Expand Up @@ -2782,7 +2783,7 @@ function run_test(string $php, $file, array $env): string
if (strpos($log_format, 'S') !== false) {
$env_lines = [];
foreach ($env as $env_var => $env_val) {
$env_lines[] = "export $env_var=" . escapeshellarg($env_val);
$env_lines[] = "export $env_var=" . escapeshellarg($env_val ?? "");
}
$exported_environment = $env_lines ? "\n" . implode("\n", $env_lines) . "\n" : "";
$sh_script = <<<SH
Expand Down

0 comments on commit c916613

Please sign in to comment.