[php-src] PR #25947: Replace boolean inputs in type juggling tests
| From: | theodorejb | Date: | Mon, 30 Nov 2026 15:27:36 +0000 |
| Subject: | [php-src] PR #25947: Replace boolean inputs in type juggling tests | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41257@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25947
Author: theodorejb
Split out of #25889 per request, so it can be reviewed separately.
Many older tests include booleans in their lists of inputs for
int, float,
or string parameters, or other scalars in their lists of inputs for bool parameters.
Each of these inputs is now replaced with the value it was converted to (0,
0.0, or "" for false, and 1,
1.0, or "1" for true), or removed when the test
already has an input which converts to the same value. The functions are called with the same values
as before, so the tests keep their coverage without relying on implicit conversions to or from
bool. Booleans which are not converted, such as array elements joined by
implode() or $res_arr values in
tempnam_variation3-win32.phpt, are kept.
The fscanf() tests which write booleans to a file as test data now convert them to
strings explicitly. call_user_func_strict_arginfo_check.phpt passes an int
instead of false to strlen(), so it still covers a weak mode conversion.
The get_cfg_var(), proc_nice(), and imageantialias() tests
which only passed booleans are removed, as the values they converted to are covered by the other
tests of these functions, with an empty string case added to
get_cfg_var_variation7.phpt.