From 56d89ecd64cdd29dbfd365ad7669a5947c8f8838 Mon Sep 17 00:00:00 2001 From: kenjis <kenji.uui@gmail.com> Date: Fri, 8 Sep 2023 12:48:51 +0900 Subject: [PATCH] test: use PHP_VERSION_ID instead of PHP_VERSION --- tests/system/Debug/TimerTest.php | 2 +- tests/system/Helpers/ArrayHelperTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/system/Debug/TimerTest.php b/tests/system/Debug/TimerTest.php index d99d877fc84a..54c9fdfccb18 100644 --- a/tests/system/Debug/TimerTest.php +++ b/tests/system/Debug/TimerTest.php @@ -172,7 +172,7 @@ public function testRecordThrowsException(): void public function testRecordThrowsErrorOnCallableWithParams(): void { - if (version_compare(PHP_VERSION, '8.0.0') >= 0) { + if (PHP_VERSION_ID >= 80000) { $this->expectException(ArgumentCountError::class); } else { $this->expectException(ErrorException::class); diff --git a/tests/system/Helpers/ArrayHelperTest.php b/tests/system/Helpers/ArrayHelperTest.php index 9a91c807c4b4..4844fe84188e 100644 --- a/tests/system/Helpers/ArrayHelperTest.php +++ b/tests/system/Helpers/ArrayHelperTest.php @@ -304,10 +304,10 @@ public function testArraySortByMultipleKeysFailsEmptyParameter(array $data, arra public function testArraySortByMultipleKeysFailsInconsistentArraySizes($data): void { // PHP 8 changes this error type - if (version_compare(PHP_VERSION, '8.0', '<')) { - $this->expectException(ErrorException::class); - } else { + if (PHP_VERSION_ID >= 80000) { $this->expectException(ValueError::class); + } else { + $this->expectException(ErrorException::class); } $this->expectExceptionMessage('Array sizes are inconsistent');