Donate to protect them directly or help international organizations.
PHPUnit Deprecations
December 14th, 2025
You may have seen this orange message at the end of a PHPUnit run PHPUnit Deprecations: 1. What many people miss when they upgrade PHPUnit is the XML configuration format. This also happens when people copy-paste the XML config from a previous project.
Finding and Fixing Incompatibilities
The easiest way, as recommended by Sebastian Bergmann, is to run phpunit --migrate-configuration, which will migrate the XML configuration file from a previous version's format to the current format.
If that fails or if you need to do it manually, then you'll need to figure out your PHPUnit version. Run phpunit --version and you'll see something like PHPUnit 12.5.3 [...].
Now go to the XML configuration file for PHPUnit and find the attribute xsi:noNamespaceSchemaLocation on the <phpunit> tag. If it's not set, add it, otherwise update it to https://schema.phpunit.de/12.5/phpunit.xsd, or whichever version phpunit reported. An IDE like PHPStorm will then allow you to fetch that XSD and will highlight in red anything that isn't valid.
Once you fix the configuration file, rerun the tests and the number of reported deprecations should go down, if not completely eliminated.
Edit 2025-12-15: add --migrate-configuration approach; make the manual instructions more clear.
