Problem/Motivation
AssertLegacyTrait::constructFieldXpath() is deprecated in drupal:8.5.0 and is removed from drupal:10.0.0. Use $this->getSession()->getPage()->findField() instead. See https://www.drupal.org/node/3129738
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | 3139442-23.patch | 12.81 KB | mondrake |
| #23 | interdiff_21-23.txt | 871 bytes | mondrake |
Comments
Comment #2
jungleAdding the "Deprecated assertions" tag to add this into the kanban board https://contribkanban.com/board/Deprecatedassertions
Comment #3
munish.kumar commentedComment #4
munish.kumar commentedComment #6
munish.kumar commentedComment #7
munish.kumar commentedComment #8
munish.kumar commentedComment #9
munish.kumar commentedComment #10
mohrerao commentedVerified for presence of constructFieldXpath with
grep -r "constructFieldXpath(" *only core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php, core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php and core/tests/Drupal/KernelTests/AssertContentTrait.php show up.
Moving to RTBC
Comment #11
alexpottOnce we're removed all the usages we can add an @trigger_error to the method. See \Drupal\FunctionalTests\AssertLegacyTrait::getAllOptions() for an example of how to do that.
Comment #12
munish.kumar commentedHi @alexpott, Thanks for the review. Correct me if I am wrong, but I found @trigger_error is already there in the method in
core/tests/Drupal/FunctionalTests/AssertLegacyTrait. see here.Comment #13
hardik_patel_12 commentedHi @alexpott, @trigger_error message is already there in core/tests/Drupal/FunctionalTests/AssertLegacyTrait as mentioned by @munish.kumar also. Deleting deprecation message from the core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php file also. Kindly review a new patch.
Comment #15
mohrerao commentedThe failures are because of usage of AssertLegacyTrait::constructFieldXpath internally by other AssertLegacyTrait methods. This should pass once Remove the usage of deprecated methods in tests lands.
Comment #16
mondrakeComment #17
mondrakeActually, postponed based on #15.
Comment #18
mondrakeAdded deprecation test. We need to start unravel the dependencies between the file related assert methods and this seems a good starting point.
Comment #19
mondrakeSorry.
Comment #21
mondrakeFixing failure of the deprecation test.
Comment #22
mondrakeComment #23
mondrakeComment #24
jungle@mondrake, thanks!
All occurrences of AssertLegacyTrait::constructFieldXpath() were replaced.
The legacy/deprecated one gets tested.
The deprecated message gets removed from getSkippedDeprecations()
Prefer using array_map
But it does not matter here.
In all, it's RTBC to me.
Comment #25
jungleActually, the check in #24.1 is unnecessary, if there are leftovers, the testing won't pass once the deprecation message gets removed from getSkippedDeprecations().
Comment #27
catchCommitted c532b2f and pushed to 9.1.x. Thanks!