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
AssertLegacyTrait::assertLinkByHref() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->linkByHrefExists() 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 |
---|---|---|---|
#26 | 3139418-26.patch | 146.89 KB | mondrake |
Comments
Comment #2
jungleAdding the "Deprecated assertions" tag to add this into the kanban board https://contribkanban.com/board/Deprecatedassertions
Comment #3
jungleOn this.
Comment #4
jungleComment #5
mondrakeComment #6
jungleThanks @mondrake!
Comment #8
jungleOne error is from calls replaced to
\Drupal\KernelTests\AssertContentTrait::assertLinkByHref()
Worthy a new issue to continue.
Comment #9
jungleHere is the issue filed for #8
Comment #10
mondrakeRerolled, removed changes to Kernel tests not relevant here, removed the BrowserTestBaseTest deprecation test - we will need a specific one instead.
Comment #11
mondrakeRerolled and added new deprecation tests.
Comment #12
junglePatch failed to apply :)
Comment #13
mondrakeComment #14
jungleAll occurrences were replaced
The two deprecated ones get tested.
Deprecation messages removed from getSkippedDeprecations().
If no CS violations and testing passes, this is RTBC to me. Cycling back later.
Comment #15
jungleHi @mondrake, why you aborted the CI runs? On purpose or by mistake? Aborting one of them makes sense to me, but both the MySQL one and the SQLite one got aborted. Re-queued.
Actually, the check in #14.1 is unnecessary, if there are leftovers, the testing won't pass once the deprecation messages get removed from getSkippedDeprecations().
Comment #16
jungleIt took about 110 mins. Aborted by CI itself?
Comment #17
mondrake#16 yes DrupalCI gets stuck with this patch, during the Unit tests run. No idea why.
Comment #18
mondrakeRerolled patch from #10 that was passing last. Rawdiff from #13 so we can see what else was added there that is blocking DrupalCI.
Comment #19
mondrakeSo the deprecation test added in #11 is probably the culprit, I can’t understand why though.
Comment #20
mondrakeThe problem was the test method calling itself and recursing endlessly. Strange that DrupalCI does not fail.
Fixed here.
Comment #21
longwaveTests were added, so removing tag.
All BrowserTestBase calls to assert[No]LinkByHref() were removed so this is RTBC.
When grepping for calls I found an interesting reference in core/modules/contact/tests/src/Functional/ContactSitewideTest.php:
This is still true in WebAssert as it builds an XPath query
//a[contains(@href, :href)]
. This is out of scope to fix completely here but should we update the comment? Also getting this on @mondrake's radar as exact URL matching is something we have improved elsewhere recently.Comment #22
mondrakeRerolled.
Comment #23
mondrakeComment #24
mondrakeWrong reroll in #22.
Comment #25
mondrake...and in #24, too.
Comment #26
mondrake... and needing a reroll already
Comment #27
alexpottCommitted 472b190 and pushed to 9.1.x. Thanks!