Problem/Motivation

AssertLegacyTrait::assert is meant for removal in Drupal 10.

Proposed resolution

Deprecate the method and remove its usage in core.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#5 3123114-5.patch1.03 KBneslee canil pinto
#2 3123114-2.patch1.03 KBmondrake

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Issue tags: +Novice
StatusFileSize
new1.03 KB

Let's start with a deprecation trigger and see what neeeds to be fixed. This is a good novice task - note though that the replacement should use the best assertion possible, not just ::assertTrue. For example, this

return $this->assert(empty($links), $message, $group);

should be converted as

return $this->assertEmpty($links, $message, $group);

while

$this->assert(strpos($content, implode(' ', $expected)) !== FALSE, 'Form alter hooks executed in the expected order.');

as

$this->assertStringContainsString(implode(' ', $expected), $content, 'Form alter hooks executed in the expected order.');

mondrake’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 3123114-2.patch, failed testing. View results

neslee canil pinto’s picture

Status: Needs work » Needs review
StatusFileSize
new1.03 KB

Status: Needs review » Needs work

The last submitted patch, 5: 3123114-5.patch, failed testing. View results

tdnshah’s picture

Assigned: Unassigned » tdnshah
tdnshah’s picture

Assigned: tdnshah » Unassigned
Status: Needs work » Fixed
Parent issue: » #3129002: Replace usages of deprecated AssertLegacyTrait::assert()

Duplicate of the issue marked as parent issue. Also a patch in parent issue resolves this https://www.drupal.org/project/drupal/issues/3129002#comment-13612418
futher discussion can be handled over there hence marking this once as fixed

Thank you

mondrake’s picture

Status: Fixed » Closed (duplicate)

Closed duplicate is more appropriate in this case.