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:255

Proposed resolution

Fix that in advance.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3594207

Command icon 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

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs review
smustgrave’s picture

When 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

mondrake’s picture

13.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.

dcam’s picture

Status: Needs review » Reviewed & tested by the community

Per #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 testInvalidVersionNumber
The 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.php
Then run the test again. It will fail with the error specified by the issue summary:

The data provider specified ... is invalid
The key must not be an empty string

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.