Problem/Motivation

A child issue of #3167880: [meta] Convert assertions involving use of xpath to WebAssert, where possible to complete conversions where possible. Several prior issues resolved most of the conversions, this is to catch most of the remaining ones.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3265574

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs work
mondrake’s picture

Status: Needs work » Needs review

This should be it. I did not try to convert cases where xpath results are traversed or part of more complex checking. Also, KernelTests are left out as Mink is not usable there.

mondrake’s picture

Rerolled

mondrake’s picture

rerolled

mondrake’s picture

rerolled

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

longwave’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Looking pretty good but this needs a rebase against 10.0.x I guess.

mondrake’s picture

Version: 9.5.x-dev » 10.1.x-dev

Ah, with a deprecation in the MR I think we need to target 10.1 now.

longwave’s picture

As that is in tests only, I think we can still deprecate in 9.5.x for removal in 10.0.x.

mondrake’s picture

Let's try that then, thx

mondrake’s picture

Version: 10.1.x-dev » 9.5.x-dev
mondrake’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

Adjusted deprecation and added CR

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, I've re-reviewed the whole patch and don't see any issues.

alexpott’s picture

Version: 9.5.x-dev » 9.4.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed c900c8d35c to 10.1.x and 8c9655ec2d to 10.0.x and f1e2cfde0a to 9.5.x. Thanks!
Committed 5551334 and pushed to 9.4.x. Thanks!

diff --git a/core/modules/block/tests/src/Functional/AssertBlockAppearsTrait.php b/core/modules/block/tests/src/Functional/AssertBlockAppearsTrait.php
index ed64c87678..f78b1404d7 100644
--- a/core/modules/block/tests/src/Functional/AssertBlockAppearsTrait.php
+++ b/core/modules/block/tests/src/Functional/AssertBlockAppearsTrait.php
@@ -40,13 +40,13 @@ protected function assertNoBlockAppears(Block $block) {
    * @return array
    *   The result from the xpath query.
    *
-   * @deprecated in drupal:9.5.0 and is removed from drupal:10.0.0. There is no
+   * @deprecated in drupal:9.5.0 and is removed from drupal:11.0.0. There is no
    *   replacement.
    *
    * @see https://www.drupal.org/node/3293310
    */
   protected function findBlockInstance(Block $block) {
-    @trigger_error(__METHOD__ . '() is deprecated in drupal:9.5.0 and is removed from drupal:10.0.0. There is no replacement. See https://www.drupal.org/node/3293310', E_USER_DEPRECATED);
+    @trigger_error(__METHOD__ . '() is deprecated in drupal:9.5.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3293310', E_USER_DEPRECATED);
     return $this->xpath('//div[@id = :id]', [':id' => 'block-' . $block->id()]);
   }
 

Changed the deprecation to be for D11 because of how late in the 9.5 cycle we are.

Backported to 9.4.x to keep tests aligned but without the deprecation.

  • alexpott committed c900c8d on 10.1.x
    Issue #3265574 by mondrake: Convert remaining assertions involving use...

  • alexpott committed 8c9655e on 10.0.x
    Issue #3265574 by mondrake: Convert remaining assertions involving use...

  • alexpott committed f1e2cfd on 9.5.x
    Issue #3265574 by mondrake: Convert remaining assertions involving use...

  • alexpott committed 5551334 on 9.4.x
    Issue #3265574 by mondrake: Convert remaining assertions involving use...

Status: Fixed » Closed (fixed)

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