Problem/Motivation
Running the unit test JsonLogTest.php produces an additional deprecation running PHPUnit version 10:
Test Triggered PHPUnit Deprecation (Drupal\Tests\jsonlog\Unit\JsonLogTest::testLogChannelFilter)
Data Provider method Drupal\Tests\jsonlog\Unit\JsonLogTest::logChannelFilterProvider() is not static
Steps to reproduce
Run jsonlog/tests/src/Unit/JsonLogTest.php with PHPUnit Version 10 on Drupal 11
Proposed resolution
Easy fix to make the function static.
Does not introduce a deprecation.
Also good to remove unused use statements.
Remaining tasks
X Create issue fork
X Create Merge Request
- Test
- Merge into 4.x-dev
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #3
scott_earnest commentedComment #4
mradcliffeThis looks good to me.
Potentially setting core_version_requirement to ^10.3 || ^11 might help for the next stable release as well in case anyone one who hasn't gotten to 10.3 tries to update and runs tests. That could also be done in the other issue as well.
Comment #5
jacobfriis commented@scott_earnest Great work! But this will not be (backwards)compatible with PHPunit 9 I presume?
In that case we'll probably have to create an new D11 line (dev branch + major version). Will do for sure, but slightly later.
Comment #6
mradcliffeIt should be easy to figure out by adding test previous major into gitlab CI yaml. I needed to add that anyway to most of my modules because of the flip to testing Drupal 11 as the current major.
Edit: I notice _TARGET_CORE is explicitly set to 10.1 and _TARGET_PHP to 8.1. Maybe that should change to
That should flip the test matrix to 10 and 11 and then 10, 11 and 12 once 12 is branched. What do you think?
Comment #7
mradcliffeAlso the test run from 3 months ago passes on PHPUnit 9:
Comment #8
mradcliffeI went ahead and just made the change in the merge request.
This proves the merge request works as-is with the 4.x branch on Drupal 10 and will work with Drupal 11 as soon as #3455244: Automated Drupal 11 compatibility fixes for jsonlog is merged as well.
Comment #10
lorenzs commentedIncluded in another D11 MR and released in version 4.1.0.