Skip to content

Commit

Permalink
Merge pull request codeigniter4#7913 from kenjis/test-refactor-PHP_VE…
Browse files Browse the repository at this point in the history
…RSION

test: use PHP_VERSION_ID instead of PHP_VERSION
  • Loading branch information
kenjis authored Sep 8, 2023
2 parents 63032a1 + 56d89ec commit 64c9a70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/system/Debug/TimerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions tests/system/Helpers/ArrayHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 64c9a70

Please sign in to comment.