Handling of configuration files
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- php
- Domain
- testing-qa
Research direction
Start by reviewing PHPUnit 10's configuration-file validation and how PHPUnit selects configuration files across versions. The issue names no repository files, tests, or entry points; a finished solution would need an agreed approach for handling version-specific settings without causing otherwise successful test runs to fail.
Written by the indexing model from the issue text.
Description
PHPUnit 10 brings both several changes to the configuration file and a misfeature of causing phpunit to exit with a non-zero status if the config file does not strictly validate.
So, for example, if you had been relying on convert{X}ToExceptions="true", you might want to set displayDetailsOnTestsThatTrigger{X}="true" and failOn{X}="true" for PHPUnit 10 to maintain that behavior going forward. But unless you also remove convert{X}ToExceptions="true", changing the behavior for runs with earlier versions of PHP, PHPUnit 10 will whine about not recognizing the old setting and will exit with a failure status even if all actual tests pass.
I don't know what the best way around this might be.
Simplest might be to provide a wrapper script that, if not passed -c or --configuration or --no-configuration, looks for various config file names and picks the best one for the current version of PHPUnit to set --configuration before execing phpunit. For example, it might check for any "phpunit.{VER}.xml.dist" and pick the one with the highest {VER} that's not greater than PHPUnit's own version.
A little fancier might be a wrapper that determines the configuration file in the same way PHPUnit would, copies it to a temporary file while stripping a predefined list of settings based on the PHPUnit version, and calls phpunit with --configuration pointing to the temporary file.
Unfortunately PHPUnit doesn't provide any way to hook into its own code to handle things more directly. There might still be ways, but they'd be fragile.
- Dominant language
- PHP
- Stars
- 189
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Yoast/PHPUnit-Polyfills
-
Roadmap v5 / PHPUnit 13May be free again @jrfnl claimed this 65 days ago, and no pull request is open. OpenType: breaking change Type: enhancement
Yoast/PHPUnit-Polyfills#313 · 1 reaction · 1 assignee ·
-
Type: chores/QA Type: documentation
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Yoast/PHPUnit-Polyfills#215 · 1 reaction ·
-
Feature: testlistener Type: enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
Yoast/PHPUnit-Polyfills#128 ·
-
Type: enhancement
Difficulty 3/5 1-2 days Newbie friendliness 38/100
Yoast/PHPUnit-Polyfills#58 · 1 comment ·
All issues in Yoast/PHPUnit-Polyfills
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Codeinwp/optimole-wp#1259 ·
Maintainers usually reply within 1 day
-
repo:ckeditor
Difficulty 1/5 Under an hour Newbie friendliness 78/100
craftcms/ckeditor#682 · 1 comment ·
Maintainers usually reply within 1 day
-
component/core domain/framework
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100