[wp-trac] [WordPress Trac] #63833: PHPUnit clases don't exist in later versions of PHPUnit
WordPress Trac
noreply at wordpress.org
Fri Aug 15 21:19:14 UTC 2025
#63833: PHPUnit clases don't exist in later versions of PHPUnit
------------------------------+-----------------------------
Reporter: danielmorell | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version: trunk
Severity: normal | Keywords:
Focuses: tests |
------------------------------+-----------------------------
Trying to run the PHPUnit test suite produces warnings when running the
tests in PHPUnit 10 or above.
{{{
[15-Aug-2025 20:58:56 UTC] PHP Warning: Class
"PHPUnit\Framework\Error\Deprecated" not found in /wordpress-
phpunit/includes/phpunit6/compat.php on line 8
[15-Aug-2025 20:58:56 UTC] PHP Warning: Class
"PHPUnit\Framework\Error\Notice" not found in /wordpress-
phpunit/includes/phpunit6/compat.php on line 9
[15-Aug-2025 20:58:56 UTC] PHP Warning: Class
"PHPUnit\Framework\Error\Warning" not found in /wordpress-
phpunit/includes/phpunit6/compat.php on line 10
[15-Aug-2025 20:58:56 UTC] PHP Warning: Class "PHPUnit\Framework\Warning"
not found in /wordpress-phpunit/includes/phpunit6/compat.php on line 12
[15-Aug-2025 20:58:56 UTC] PHP Warning: Class
"PHPUnit\Framework\TestListener" not found in /wordpress-
phpunit/includes/phpunit6/compat.php on line 15
}}}
I think instead of blindly calling `class_alias()` on each of these, it
would be better to wrap each in a call to `class_exists()`. This could
easily be done in a `foreach` loop.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63833>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list