Problem/Motivation
PHPUnit 13.2 strated throwing errors for
1) Drupal\Tests\Core\Extension\ExtensionVersionTest::testInvalidVersionNumber
The data provider specified for Drupal\Tests\Core\Extension\ExtensionVersionTest::testInvalidVersionNumber is invalid
The key must not be an empty string
/builds/core/tests/Drupal/Tests/Core/Extension/ExtensionVersionTest.php:255Proposed resolution
Fix that in advance.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3594207
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mondrakeComment #4
smustgrave commentedWhen I run the test with 13.2 I get
RuntimeException: testInvalidVersionNumber registered its own error handler without restoring the previous one before or during tear down. This can cause unpredictable test results. Ensure the test cleans up after itself.
/var/www/html/core/tests/Drupal/Tests/DrupalTestCaseTrait.php:78
Comment #5
mondrake13.2 won't work with Drupal: PHPUnit 13.2 breaks Drupal's approach for ignoring deprecations #6705.
You need to bump to 13.3-dev (which the MR in the parent issue does, but that one also includes the change here, so do not expect a test failure with it). The issue here is occurring from 13.2, nevertheless.
Comment #6
dcam commentedPer #5 the easiest way to test this is to clone the MR from #3574681: [Nov 2026] Introduce support for PHPUnit 13.5, install the updated dependencies, then run the test:
phpunit core/tests/Drupal/Tests/Core/Extension/ExtensionVersionTest.php --filter testInvalidVersionNumberThe test will pass. Check out the test file to get it back to a failing state:
git checkout main -- core/tests/Drupal/Tests/Core/Extension/ExtensionVersionTest.phpThen run the test again. It will fail with the error specified by the issue summary:
The fix in this MR is the same as that from #3574681. Because the test passes with this fix in place, it looks good to me. I didn't note any problems with the few code changes introduced.