Makes the replacement easier to see, neatly aligned, and only takes one function call.
This is safe because none of the combined replacement values contain tokens that would be recursively replaced.
This also improves the readability on how the regular expressions in `EXPECTF` matcher is constructed.
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
The rationale is that `shell_exec()` is identical to the backtick operator (both of which are disabled when `shell_exec` function is disabled) makes it very clear that it is a shell execution, and eases security audits too.
Simplifies and improves the readability of multiple `if`/`elseif`/`else` blocks by removing them when an earlier branch exists the execution flow by either returning or terminating the script.
The `--CGI--` section is supposed to be just a marker, and to be empty
as such. However, a previous refactoring[1] broke that.
[1] <9140c9038a>
Closes GH-9061.
The $php_cgi and $phpdbg cases here are definitely real bugs, and
caused the script to bail out under certain ini settings.
The other paths may actually be unreachable in practice, but were
highlighted by PhpStorm.
* PHP-8.1:
run-tests.php: fix TypeError: Unsupported operand types: string * int <n> is mandatory for --show-slow and --set-timeout use <n> in help message instead of confusing [n]
* PHP-8.0:
run-tests.php: fix TypeError: Unsupported operand types: string * int <n> is mandatory for --show-slow and --set-timeout use <n> in help message instead of confusing [n]
When run-tests.php has been typed[1], the type of `$time` has been
chosen to be `int`. This, however, leads to truncation, and the
somewhat relevant subsecond precision is lost. We fix that by
changing the type to `float`, although `int|string` would be more
appropriate, but requires PHP ≥ 7.4.0. Another option would be to
move the `number_format()` formatting into `junit_mark_test_as()`.
[1] <11274f53e7>
Closes GH-7836.
This is a tiny improvement to run-tests.php which helps keep it from
tripping over hidden files, including autosave files from various
editors, metadata on certain platforms, etc.
Closes GH-7783.
DISABLE_SKIP_CACHE=1 can be used to disable the skip cache. This
does not control the extensions cache.
See https://externals.io/message/116044 for related discussion.
Closes GH-7510.
This format matches against null bytes, and prevents the test
expectation from being interpreted as binary data.
bless_tests.php will automatically replace \0 with %0 as well.
PR #6787 changed the behavior of the `--EXTENSIONS--` section, so that
not yet loaded extensions are dynamically loaded if possible. However,
when no tests are specified for the runner, only tests for already
loaded extensions are run, what defeats the purpose of the improvement
of the `--EXTENSIONS--` behavior. We cater to that by detecting
loadable extensions, and also run their tests.