-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
feature/process-isolationIssues related to running tests in separate PHP processesIssues related to running tests in separate PHP processesfeature/test-runnerCLI test runnerCLI test runnertype/bugSomething is brokenSomething is brokenversion/10Something affects PHPUnit 10Something affects PHPUnit 10version/9Something affects PHPUnit 9Something affects PHPUnit 9
Description
We have this code (PHPUnit 9.6, PHPUnit 10.0)
$result = '';
foreach (ini_get_all(null, false) as $key => $value) {
$result .= sprintf(
'@ini_set(%s, %s);' . "\n",
self::exportVariable($key),
self::exportVariable((string) $value)
);
}to generate code that when run in a separate process reproduces the PHP configuration in the parent process.
This can, for instance, lead to
@ini_set('mbstring.internal_encoding', '');being run, which triggers a warning because mbstring.internal_encoding is deprecated.
We should avoid generating ini_set() calls for values that are not configured in the parent process.
It is unclear whether $value === null can be safely used to detect whether a value is configured or not.
As the error suppression operator @ is used, this should only ever be a problem when a custom error handler does not honor the fact that such a warning should be ignored.
Metadata
Metadata
Assignees
Labels
feature/process-isolationIssues related to running tests in separate PHP processesIssues related to running tests in separate PHP processesfeature/test-runnerCLI test runnerCLI test runnertype/bugSomething is brokenSomething is brokenversion/10Something affects PHPUnit 10Something affects PHPUnit 10version/9Something affects PHPUnit 9Something affects PHPUnit 9