Skip to content

Commit 987fc5d

Browse files
committed
php 8.5 compatibility
1 parent 14ebed9 commit 987fc5d

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

tests/Debug/Type/BasicTest.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,12 +669,18 @@ public static function providerTestMethod()
669669
),
670670
);
671671

672-
// $tests = \array_intersect_key($tests, \array_flip(array('callable')));
672+
// phpunit issue with php 8.5 causing INF and NAN tests to fail
673+
if (PHP_VERSION_ID >= 80500) {
674+
$tests = \array_diff_key($tests, \array_flip(array(
675+
'float.inf',
676+
'float.NaN',
677+
)));
678+
}
673679

674-
return \array_map(function ($test) {
680+
return \array_map(static function ($test) {
675681
return \is_callable($test)
676-
? $test()
677-
: $test;
682+
? $test()
683+
: $test;
678684
}, $tests);
679685
}
680686
}

tests/Debug/Utility/PhpTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,11 @@ public function testGetIncludedFiles()
5050

5151
public function testGetIniFiles()
5252
{
53-
self::assertSame(
54-
\array_merge(
55-
array(\php_ini_loaded_file()),
56-
\preg_split('#\s*[,\r\n]+\s*#', \trim(\php_ini_scanned_files()))
57-
),
58-
Php::getIniFiles()
59-
);
53+
$expect = \array_filter(\array_merge(
54+
array(\php_ini_loaded_file()),
55+
\preg_split('#\s*[,\r\n]+\s*#', \trim(\php_ini_scanned_files()))
56+
));
57+
self::assertSame($expect, Php::getIniFiles());
6058
}
6159

6260
/**

tests/ErrorHandler/ErrorHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ public function testThrowErrorException()
569569
$trace = $exception->getTrace();
570570
self::assertSame($errorVals['file'], $trace[1]['file']);
571571
self::assertSame($backtraceLine, $trace[1]['line']);
572-
PHP_VERSION_ID >= 70000
572+
PHP_VERSION_ID >= 70000 && PHP_VERSION_ID < 80500
573573
? self::assertSame('bdk\\Test\\ErrorHandler\\ErrorHandlerTest->raiseError', $trace[1]['function'])
574574
: self::assertSame('bdk\\Test\\ErrorHandler\\AbstractTestCase->raiseError', $trace[1]['function']);
575575
self::assertSame(__CLASS__ . '->' . __FUNCTION__, $trace[2]['function']);

0 commit comments

Comments
 (0)