Skip to content

Commit

Permalink
Closes #4575
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jan 7, 2021
1 parent 957aaf3 commit 83491f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
1 change: 1 addition & 0 deletions ChangeLog-8.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil

* [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly
* [#4572](https://github.com/sebastianbergmann/phpunit/issues/4572): Schema validation does not work with `%xx` sequences in path to `phpunit.xsd`
* [#4575](https://github.com/sebastianbergmann/phpunit/issues/4575): PHPUnit 8.5 incompatibility with PHP 8.1

## [8.5.13] - 2020-12-01

Expand Down
26 changes: 8 additions & 18 deletions src/Util/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,26 +434,16 @@ public function handlePHPConfiguration(): void
}
}

foreach (['var', 'post', 'get', 'cookie', 'server', 'files', 'request'] as $array) {
/*
* @see https://github.com/sebastianbergmann/phpunit/issues/277
*/
switch ($array) {
case 'var':
$target = &$GLOBALS;

break;

case 'server':
$target = &$_SERVER;

break;
foreach ($configuration['var'] as $name => $data) {
$GLOBALS[$name] = $data['value'];
}

default:
$target = &$GLOBALS['_' . strtoupper($array)];
foreach ($configuration['server'] as $name => $data) {
$_SERVER[$name] = $data['value'];
}

break;
}
foreach (['post', 'get', 'cookie', 'files', 'request'] as $array) {
$target = &$GLOBALS['_' . strtoupper($array)];

foreach ($configuration[$array] as $name => $data) {
$target[$name] = $data['value'];
Expand Down

0 comments on commit 83491f4

Please sign in to comment.