Using assert[Not]Equals() to compare markup between MarkupInterface objects and plain strings is deprecated

Created on 10 February 2023, almost 2 years ago

Problem/Motivation

DrupalCI currently throws a deprecation error:

Testing Drupal\Tests\view_mode_switch\Kernel\ViewModeSwitchTest

Remaining self deprecation notices (1)

  1x: Using assert[Not]Equals() to compare markup between MarkupInterface objects and plain strings is deprecated in drupal:10.1.0 and will throw an error from drupal:11.0.0. Expected: 'View' - Actual 'View'. Use assert[Not]Same() and cast objects to string instead. See https://www.drupal.org/node/3334057
    1x in ViewModeSwitchTest::testGetViewModeToSwitchToRecursionDetection from Drupal\Tests\view_mode_switch\Kernel

Steps to reproduce

Run 2.x-dev test with PHP 8.1 & MySQL 5.7, Drupal 10.1.x test in DrupalCI and check logs.

Proposed resolution

Adjust test case and remove/replace deprecated code

Remaining tasks

Create a patch / issue fork

User interface changes

n/a

API changes

n/a

Data model changes

n/a

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany hctom

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024