Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
ApcuBackendTest
has both @requires and odd \Drupal\KernelTests\Core\Cache\ApcuBackendTest::getRequirements / \Drupal\KernelTests\Core\Cache\ApcuBackendTest::requirementsFail code.
I think now we have @requires extension apcu
we can remove the requirements code because it'll never fail.
Proposed resolution
- Remove \Drupal\KernelTests\Core\Cache\ApcuBackendTest::getRequirements() and \Drupal\KernelTests\Core\Cache\ApcuBackendTest::requirementsFail()
- Remove all calls to those methods and remove overrides of tests where possible - for example testDelete no longer needs an override.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
N/a
Comment | File | Size | Author |
---|---|---|---|
#11 | interdiff-3054315-6-11.txt | 811 bytes | yogeshmpawar |
#11 | 3054315-11.patch | 4.09 KB | yogeshmpawar |
#6 | interdiff-3054315-4-6.txt | 1.49 KB | yogeshmpawar |
#6 | 3054315-6.patch | 3.65 KB | yogeshmpawar |
#4 | 3054315-4.patch | 4.03 KB | yogeshmpawar |
Comments
Comment #2
alexpottComment #3
yogeshmpawarComment #4
yogeshmpawarComment #5
alexpottThanks for working on this @yogeshmpawar.
Where we are just calling the parent and doing nothing else we can remove the entire method.
Comment #6
yogeshmpawarThanks @alexpott, Updated the patch as per comment #5 & also added an interdiff.
Comment #7
alexpott1 files changed, 0 insertions, 145 deletions.
love it!Comment #8
borisson_This looks great and it passes tests. I don't see anything else that we can improve on this.
Comment #9
alexpottWas so about to commit this and then realised there's one more thing.
This test does
So this check is moot and can be:
No need to think about apc (without the u) and no need to check if classes exist.
Comment #10
alexpottAlso we should open a follow-up to remove Apcu4Backend from the codebase - I'm pretty sure the apcu4 is a PHP5 only thing and therefore no longer supported by Drupal.
Comment #11
yogeshmpawarRemoving check as per comment #9 & adding interdiff as well.
Comment #12
BerdirLooks good. Created #3058498: Deprecate/Remove Apcu4Backend
Comment #13
alexpottCommitted and pushed ef6a11d84a to 8.8.x and e91c5eca76 to 8.7.x. Thanks!
Backported to 8.7.x to keep the tests aligned.
Comment #16
alexpottThis change broke PHP5 on 8.7.x - reverting. There's no need to backport the change.