Add more complex (responsive_)image tests

Created on 24 April 2023, about 1 year ago

Problem/Motivation

When implementing πŸ› drupal_image() needs #width / #height values for fully working image cache scale, lazy-loading and img attributes RTBC I saw that image_style didn't have any effects, which leads to a less "real-life" test. For example the #width and #height result was never tested properly, so the issue couldn't be found.

A similar case exists for the responsive style test as only one breakpoint is defined and it's without any imagecache effects assigned:

$responsiveImageStyle = ResponsiveImageStyle::create(['id' => 'wide']);
$responsiveImageStyle->save();

For testing the very basic functionality that's okay, but for "real-life" examples I think it might not be enough, as it doesn't show the typical cases where more than one breakpoint is active typically, using different image sizes.

Do we perhaps also need functional tests like in:
web/core/modules/image/tests/src/Functional/ImageDimensionsTest.php
to ensure issues like this don't appear again and we can be sure all expected parameters are present?
Or would it be too much, as we're just using core functionality?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

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

Comments & Activities

Production build 0.69.0 2024