Skip to content

Add support for phpunit.dist.xml configuration file#344

Open
takamichi wants to merge 2 commits into
nunomaduro:v8.xfrom
takamichi:phpunit-conf-file
Open

Add support for phpunit.dist.xml configuration file#344
takamichi wants to merge 2 commits into
nunomaduro:v8.xfrom
takamichi:phpunit-conf-file

Conversation

@takamichi

Copy link
Copy Markdown

This PR adds support for recognizing phpunit.dist.xml, which was introduced in PHPUnit 10.

Currently, phpunit.xml and phpunit.xml.dist are supported, but phpunit.dist.xml is not. This PR adds phpunit.dist.xml as a resolution target and aligns the lookup order with PHPUnit:

  1. phpunit.xml
  2. phpunit.dist.xml
  3. phpunit.xml.dist

Copilot AI review requested due to automatic review settings February 10, 2026 09:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.xml as a configuration file candidate.
  • Align configuration file lookup order to: phpunit.xmlphpunit.dist.xmlphpunit.xml.dist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +237 to +246
$candidates = [
'phpunit.xml',
'phpunit.dist.xml',
'phpunit.xml.dist',
];

foreach ($candidates as $candidate) {
if (file_exists($file = base_path($candidate))) {
break;
}

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants