Closed (fixed)
Project:
Rules
Version:
4.0.x-dev
Component:
Tests
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Apr 2024 at 18:12 UTC
Updated:
9 Jul 2024 at 18:14 UTC
Jump to comment: Most recent
Running PHPunit tests, the results includes these two self deprecation notices:
Remaining self deprecation notices (7145)
7020x: The Drupal\Core\Extension\Discovery\RecursiveExtensionFilterIterator is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Extension\Discovery\RecursiveExtensionFilterCallback instead. See https://www.drupal.org/node/3343023
2080x in AnnotationProcessingTest::setUp from Drupal\Tests\rules\Unit\Integration\Engine
1040x in UnBanIpTest::setUp from Drupal\Tests\rules\Unit\Integration\RulesAction
1040x in BanIpTest::setUp from Drupal\Tests\rules\Unit\Integration\RulesAction
780x in PathHasAliasTest::setUp from Drupal\Tests\rules\Unit\Integration\Condition
780x in PathAliasExistsTest::setUp from Drupal\Tests\rules\Unit\Integration\Condition
...
122x: Calling FieldTypePluginManager::__construct() without the $fieldTypeCategoryManager argument is deprecated in drupal:10.2.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3375737
19x in IntegrityCheckTest::setUp from Drupal\Tests\rules\Unit\Integration\Engine
10x in LoopTest::setUp from Drupal\Tests\rules\Unit\Integration\Engine
5x in UserUnblockTest::setUp from Drupal\Tests\rules\Unit\Integration\RulesAction
5x in EntityFetchByFieldTest::setUp from Drupal\Tests\rules\Unit\Integration\RulesAction
5x in UserRoleAddTest::setUp from Drupal\Tests\rules\Unit\Integration\RulesAction
...
This isn't urgent now but will need to be done before a Drupal 11 version and shouldn't hurt to do ASAP in the next release.
Run phpunit --testsuite="unit" with rules installed.
The first one sounds like a straightforward swapping out one function for another. The other needs a new parameter so I don't know how much that entails.
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
tr commentedYes, deprecations are introduced into core all the time - this is just a normal part of keeping the module up-to-date, not a bug.
That's why we have automated testing - so we see these things. It's not necessary to post an issue for notices in the tests unless you want to provide a patch to address these issues.
The deprecation notices are simply notices that something will be changing in the future - in this case the current code is just fine and will be fine until Drupal 11.
Are you planning on providing a patch for this issue?
Comment #5
tr commentedThe first issue is because of the core Drupal change made in RecursiveExtensionFilterIterator is deprecated
The second one is a duplicate of your issue in #3425542: [10.2] PHPUnit errors: non-existent service plugin.manager.field.field_type_category, and there is a fix in that issue.
I have changed the issue title to reflect that the first one is the only one that needs to be addressed here.
Comment #7
ankitv18 commentedWill raise a MR against 4.0.x considering comment#5
Comment #8
ankitv18 commented@TR getting this error when I'm trying to create branch
Failed to create branch '3437436-fix-deprecation': invalid reference name '4.0.x'Comment #10
ankitv18 commentedMR!34 is ready for review. Fixed the objective of the ticket ~~ phpunit isn't failing due to deprecated RecursiveExtensionFilterIterator
Comment #11
tr commentedTwo things:
Comment #12
ankitv18 commentedAlright, considering your feedback removed conditional statement and fixed the proper implementation as per change notice.
Earlier I went through the codebase to implement the approach. :(
Comment #14
tr commentedThanks, looks good. I made some changes to the comments and merged.