Problem/Motivation
PHPUnit has a faster release cadence than Drupal and drops support for PHP versions quicker than we do. See https://phpunit.de/supported-versions.html. This leads to issues like:
- #3039275: phpunit-mock-objects is marked as "abandoned" when composer.lock is rebuilt
- #2927806: Use PHPUnit 6 for testing when PHP version >= 7.2
- #2937469: Automatic upgrade to PHPUnit 6 is dangerous
We're also always playing catch up and have to do issues like #2950132: Support PHPUnit 7 optionally in Drupal 8, while keeping support for ^6.5.
Proposed resolution
Symfony does not include phpunit in its composer.json. Instead it uses a custom PHPUnit runner called simple-phpunit that selects the correct PHPUnit version for the PHP version you are running on. It exists to:
Provides a modified version of PHPUnit that does not embed symfony/yaml nor prophecy to prevent any conflicts with these dependencies.
https://symfony.com/doc/current/components/phpunit_bridge.html
Remaining tasks
- Implement.
- I think we should consider moving to simple-phpunit in Drupal 8 and deprecating PHPUnit via composer.json somehow and then removing that in Drupal 9
- A big unresolved question is if we do this what happens to the testing user interface? It would need to detect that simple-phpunit has been run to get the dependencies or something like that. See #3028663: Split up simpletest into simpletest and testing_ui to enable easier decisions for Drupal 9 for more about the testing UI
User interface changes
TBD
API changes
TDB
Data model changes
None
Release notes snippet
@todo