Add support for phpunit.dist.xml configuration file#344
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Laravel adapter’s PHPUnit configuration file discovery to recognize the newer phpunit.dist.xml name (introduced in PHPUnit 10) and to match PHPUnit’s documented lookup precedence.
Changes:
- Add
phpunit.dist.xmlas a configuration file candidate. - Align configuration file lookup order to:
phpunit.xml→phpunit.dist.xml→phpunit.xml.dist.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $candidates = [ | ||
| 'phpunit.xml', | ||
| 'phpunit.dist.xml', | ||
| 'phpunit.xml.dist', | ||
| ]; | ||
|
|
||
| foreach ($candidates as $candidate) { | ||
| if (file_exists($file = base_path($candidate))) { | ||
| break; | ||
| } |
There was a problem hiding this comment.
This change alters configuration file resolution order and adds support for phpunit.dist.xml, but there’s no automated coverage ensuring the intended precedence (phpunit.xml > phpunit.dist.xml > phpunit.xml.dist) stays correct. Consider adding a unit/integration test that manipulates these files (e.g., in the tests/LaravelApp fixture) and asserts which config is selected when multiple candidates exist.
This PR adds support for recognizing
phpunit.dist.xml, which was introduced in PHPUnit 10.Currently,
phpunit.xmlandphpunit.xml.distare supported, butphpunit.dist.xmlis not. This PR addsphpunit.dist.xmlas a resolution target and aligns the lookup order with PHPUnit:phpunit.xmlphpunit.dist.xmlphpunit.xml.dist