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.

Issue fork pcb-3474283

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

ambient.impact created an issue. See original summary.

ambient.impact’s picture

Assigned: ambient.impact » Unassigned
Status: Active » Needs review
shubhangi1995’s picture

StatusFileSize
new166.19 KB

Tested the issue without above changes and with above changes
screenshot for testing

nikunjkotecha’s picture

Version: 3.0.x-dev » 4.0.x-dev
nikunjkotecha’s picture

Status: Needs review » Needs work

Please raise MR against 4.0.x and also check Error handler has changed error

shubhangi1995’s picture

Assigned: Unassigned » shubhangi1995

nikunjkotecha’s picture

Status: Needs work » Fixed
shubhangi1995’s picture

Assigned: shubhangi1995 » Unassigned
StatusFileSize
new122.97 KB

https://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
test pass

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.