Skip to content

Commit

Permalink
Simplify test code
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Friedman <[email protected]>
  • Loading branch information
iMattPro committed Jan 18, 2024
1 parent a747b17 commit 9954a9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/controller/add_prefix_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public function test_add_prefix($prefix, $submit, $valid_form)
if (!$valid_form)
{
// Throws E_WARNING in PHP 8.0+ and E_USER_WARNING in earlier versions
$exceptionName = version_compare(PHP_VERSION, '8.0', '<') ? \PHPUnit\Framework\Error\Error::class : \PHPUnit\Framework\Error\Warning::class;
$errno = version_compare(PHP_VERSION, '8.0', '<') ? E_USER_WARNING : E_WARNING;
$exceptionName = PHP_VERSION_ID < 80000 ? \PHPUnit\Framework\Error\Error::class : \PHPUnit\Framework\Error\Warning::class;
$errno = PHP_VERSION_ID < 80000 ? E_USER_WARNING : E_WARNING;
$this->expectException($exceptionName);
$this->expectExceptionCode($errno);
}
Expand Down

0 comments on commit 9954a9c

Please sign in to comment.