Replace assertions involving calls to strpos() with more accurate string assertions

Created on 9 December 2024, 3 months ago

Problem/Motivation

Use proper assertion.
E.g. assertStringContainsString(), assertStringNotContainsString(),...
Follow-up for 🐛 Crop API is not appending a hash when the image styles are converted to WEBP Needs review .

Steps to reproduce

Command

grep -nri '\->assert.*strpos' crop

Result

grep -nri '\->assert.*strpos' crop
crop/tests/src/Functional/CropFunctionalTest.php:193:    $this->assertTrue(strpos($image_style_uri_url, $shortened_hash) !== FALSE, 'The image style URL contains a shortened hash.');
crop/tests/src/Functional/CropFunctionalTest.php:196:    $this->assertTrue(strpos($image_style_url, $shortened_hash) !== FALSE, 'The image style URL contains a shortened hash.');
crop/tests/src/Functional/CropFunctionalTest.php:204:    $this->assertFalse(strpos($image_style_url, $old_hash) !== FALSE, 'The image style URL does not contain the old hash.');
crop/tests/src/Functional/CropFunctionalTest.php:205:    $this->assertTrue(strpos($image_style_url, $new_hash) !== FALSE, 'The image style URL contains an updated hash.');

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇷🇺Russia zniki.ru

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024