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

Created on 10 February 2023, over 1 year 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.69.0 2024