Skip to content

Commit 83491f4

Browse files
Closes #4575
1 parent 957aaf3 commit 83491f4

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

ChangeLog-8.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
88

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

1213
## [8.5.13] - 2020-12-01
1314

src/Util/Configuration.php

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -434,26 +434,16 @@ public function handlePHPConfiguration(): void
434434
}
435435
}
436436

437-
foreach (['var', 'post', 'get', 'cookie', 'server', 'files', 'request'] as $array) {
438-
/*
439-
* @see https://github.com/sebastianbergmann/phpunit/issues/277
440-
*/
441-
switch ($array) {
442-
case 'var':
443-
$target = &$GLOBALS;
444-
445-
break;
446-
447-
case 'server':
448-
$target = &$_SERVER;
449-
450-
break;
437+
foreach ($configuration['var'] as $name => $data) {
438+
$GLOBALS[$name] = $data['value'];
439+
}
451440

452-
default:
453-
$target = &$GLOBALS['_' . strtoupper($array)];
441+
foreach ($configuration['server'] as $name => $data) {
442+
$_SERVER[$name] = $data['value'];
443+
}
454444

455-
break;
456-
}
445+
foreach (['post', 'get', 'cookie', 'files', 'request'] as $array) {
446+
$target = &$GLOBALS['_' . strtoupper($array)];
457447

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

0 commit comments

Comments
 (0)