diff --git a/.laminas-ci.json b/.laminas-ci.json index cf5a466..1b58f96 100644 --- a/.laminas-ci.json +++ b/.laminas-ci.json @@ -1,7 +1,4 @@ { - "ignore_php_platform_requirements": { - "8.4": true - }, "extensions": [ "apcu", "bcmath", diff --git a/test/RunnerTest.php b/test/RunnerTest.php index 76f5a23..b56792e 100644 --- a/test/RunnerTest.php +++ b/test/RunnerTest.php @@ -30,7 +30,7 @@ use function is_string; -use const E_USER_WARNING; +use const E_USER_ERROR; use const E_WARNING; use const PHP_MAJOR_VERSION; @@ -347,13 +347,13 @@ public function testPHPWarningResultsInFailure(): void public function testPHPUserErrorResultsInFailure(): void { - $check = new TriggerUserError('error'); + $check = new TriggerUserError('error', E_USER_ERROR); $this->runner->addCheck($check); $results = $this->runner->run(); self::assertInstanceOf(Failure::class, $results[$check]); self::assertInstanceOf(ErrorException::class, $results[$check]->getData()); - self::assertSame((new ErrorException())->getSeverity(), $results[$check]->getData()->getSeverity()); + self::assertSame(E_USER_ERROR, $results[$check]->getData()->getSeverity()); } public function testBreakOnFirstFailure(): void diff --git a/test/TestAsset/Check/TriggerUserError.php b/test/TestAsset/Check/TriggerUserError.php index 6104dd8..0265d66 100644 --- a/test/TestAsset/Check/TriggerUserError.php +++ b/test/TestAsset/Check/TriggerUserError.php @@ -15,8 +15,11 @@ public function __construct(private string $message, private int $severity, priv { } + /** @return bool */ public function check() { - throw new \ErrorException($this->message); + trigger_error($this->message, $this->severity); + + return $this->result; } }