sanmai/phpunit-legacy-adapter
Compatibility adapter for running legacy PHPUnit test suites on newer PHPUnit versions. Helps bridge API changes, keep older tests passing, and smooth migrations without rewriting everything. Suitable for maintaining long-lived PHP projects with outdated test setups.
void return type requirements. This is a highly targeted solution for teams maintaining older PHP stacks while adopting newer PHPUnit features.void return types are unsupported).assertTrue()) from older PHPUnit versions, but does not add new ones. Teams relying on PHPUnit 8+ assertions (e.g., assertSame() enhancements) may need additional logic.__call() or other magic methods.php-parallel-lint) interact with the adapter.composer.json:
"require-dev": {
"sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1"
}
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/vendor/sanmai/phpunit-legacy-adapter/autoload.php';
excludedFiles).--debug to confirm adapter activation.setUp(), custom test classes).phpunit:8.2 alongside 6.4) may cause conflicts.php-parallel-lint).opcache.enable=1 in PHP config).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| PHPUnit upgrade beyond 8.2.1 | Adapter breaks, tests fail silently | Pin PHPUnit version; monitor adapter updates. |
| Custom test methods conflict | Adapter fails to wrap methods | Exclude problematic test files; refactor. |
| Static analysis tool false positives | CI builds fail due to "undefined" return types | Configure tool exclusions (e |
How can I help you explore Laravel packages today?