Skip to content

Commit 56d89ec

Browse files
committed
test: use PHP_VERSION_ID instead of PHP_VERSION
1 parent aa2ca35 commit 56d89ec

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/system/Debug/TimerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function testRecordThrowsException(): void
172172

173173
public function testRecordThrowsErrorOnCallableWithParams(): void
174174
{
175-
if (version_compare(PHP_VERSION, '8.0.0') >= 0) {
175+
if (PHP_VERSION_ID >= 80000) {
176176
$this->expectException(ArgumentCountError::class);
177177
} else {
178178
$this->expectException(ErrorException::class);

tests/system/Helpers/ArrayHelperTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,10 @@ public function testArraySortByMultipleKeysFailsEmptyParameter(array $data, arra
304304
public function testArraySortByMultipleKeysFailsInconsistentArraySizes($data): void
305305
{
306306
// PHP 8 changes this error type
307-
if (version_compare(PHP_VERSION, '8.0', '<')) {
308-
$this->expectException(ErrorException::class);
309-
} else {
307+
if (PHP_VERSION_ID >= 80000) {
310308
$this->expectException(ValueError::class);
309+
} else {
310+
$this->expectException(ErrorException::class);
311311
}
312312

313313
$this->expectExceptionMessage('Array sizes are inconsistent');

0 commit comments

Comments
 (0)