Problem/Motivation
Try to run tests on Drupal 10.3, get this:
Fatal error: Declaration of Drupal\Tests\pcb\Kernel\PermanentDatabaseBackendTest::testSetGet() must be compatible with Drupal\KernelTests\Core\Cache\GenericCacheBackendUnitTestBase::testSetGet(): void in /var/www/html/web/modules/contrib/pcb/tests/src/Kernel/PermanentDatabaseBackendTest.php on line 59
Steps to reproduce
Run tests on Drupal 10.3 or higher. Get above error.
Proposed resolution
Add void return types to methods that are overridden from GenericCacheBackendUnitTestBase. This should not affect compatibility with 10.2 or lower because making a return type more restrictive when extending or implementing an interface is generally permitted in PHP, but not the other way around. See #3421418: [May 2024] Add void return typehints to all test methods for background.
Remaining tasks
See above.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | Screenshot from 2024-09-25 13-37-14.png | 122.97 KB | shubhangi1995 |
| #3 | Screenshot from 2024-09-24 14-37-17.png | 166.19 KB | shubhangi1995 |
Issue fork pcb-3474283
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 #2
ambient.impactComment #3
shubhangi1995Tested the issue without above changes and with above changes

Comment #4
nikunjkotechaComment #5
nikunjkotechaPlease raise MR against 4.0.x and also check Error handler has changed error
Comment #6
shubhangi1995Comment #9
nikunjkotechaComment #10
shubhangi1995https://git.drupalcode.org/project/pcb/-/merge_requests/6 is the MR with changes against 4.0.x branch.
Note: The error is related to symfony/PHPUnit-bridge which has been removed https://www.drupal.org/project/drupal/issues/3417066 impacting MR https://git.drupalcode.org/project/drupal/-/merge_requests/6326/diffs#39...
post removing symfony/PHPUnit-bridge it works fine
