Skip to content

Commit

Permalink
refactor: remove version check PHP_VERSION_ID >= 80000
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Sep 23, 2023
1 parent a408c39 commit 9035836
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
7 changes: 1 addition & 6 deletions tests/system/Debug/TimerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use ArgumentCountError;
use CodeIgniter\Test\CIUnitTestCase;
use ErrorException;
use RuntimeException;

/**
Expand Down Expand Up @@ -172,11 +171,7 @@ public function testRecordThrowsException(): void

public function testRecordThrowsErrorOnCallableWithParams(): void
{
if (PHP_VERSION_ID >= 80000) {
$this->expectException(ArgumentCountError::class);
} else {
$this->expectException(ErrorException::class);
}
$this->expectException(ArgumentCountError::class);

$timer = new Timer();
$timer->record('error', 'strlen');
Expand Down
9 changes: 1 addition & 8 deletions tests/system/Helpers/ArrayHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace CodeIgniter\Helpers;

use CodeIgniter\Test\CIUnitTestCase;
use ErrorException;
use ValueError;

/**
Expand Down Expand Up @@ -303,13 +302,7 @@ public function testArraySortByMultipleKeysFailsEmptyParameter(array $data, arra
*/
public function testArraySortByMultipleKeysFailsInconsistentArraySizes($data): void
{
// PHP 8 changes this error type
if (PHP_VERSION_ID >= 80000) {
$this->expectException(ValueError::class);
} else {
$this->expectException(ErrorException::class);
}

$this->expectException(ValueError::class);
$this->expectExceptionMessage('Array sizes are inconsistent');

$sortColumns = [
Expand Down

0 comments on commit 9035836

Please sign in to comment.