diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7e48854..b4a0153 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
+### Fixed
+- fix tests running on 11.2-dev with rendered avif image
## [6.0.4] - 2025-05-15
### Removed
diff --git a/tests/src/Kernel/Render/ImageTest.php b/tests/src/Kernel/Render/ImageTest.php
index d37657b..acb24b7 100644
--- a/tests/src/Kernel/Render/ImageTest.php
+++ b/tests/src/Kernel/Render/ImageTest.php
@@ -143,8 +143,12 @@ public function testRenderImageFile() {
$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);
+ // Since Drupal 10.3 the image styles are rendered as avif.
+ if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
+ $this->assertMatchesRegularExpression('/^
/', $markup->__toString());
+ }
// Since Drupal 10.3 the image styles are rendered as webp.
- if (version_compare(\Drupal::VERSION, '10.3', '>=')) {
+ elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^
/', $markup->__toString());
}
else {
@@ -163,8 +167,12 @@ public function testRenderImageFile() {
$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);
+ // Since Drupal 10.3 the image styles are rendered as avif.
+ if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
+ $this->assertMatchesRegularExpression('/^
/', $markup->__toString());
+ }
// Since Drupal 10.3 the image styles are rendered as webp.
- if (version_compare(\Drupal::VERSION, '10.3', '>=')) {
+ elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^
/', $markup->__toString());
}
else {
@@ -183,8 +191,12 @@ public function testRenderImageFile() {
$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);
+ // Since Drupal 10.3 the image styles are rendered as avif.
+ if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
+ $this->assertMatchesRegularExpression('/^
/', $markup->__toString());
+ }
// Since Drupal 10.3 the image styles are rendered as webp.
- if (version_compare(\Drupal::VERSION, '10.3', '>=')) {
+ elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^
/', $markup->__toString());
}
else {
@@ -217,8 +229,12 @@ public function testRenderImageMedia() {
$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);
+ // Since Drupal 10.3 the image styles are rendered as avif.
+ if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
+ $this->assertMatchesRegularExpression('/^
/', $markup->__toString());
+ }
// Since Drupal 10.3 the image styles are rendered as webp.
- if (version_compare(\Drupal::VERSION, '10.3', '>=')) {
+ elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^
/', $markup->__toString());
}
else {
@@ -237,8 +253,12 @@ public function testRenderImageMedia() {
$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);
+ // Since Drupal 10.3 the image styles are rendered as avif.
+ if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
+ $this->assertMatchesRegularExpression('/^
/', $markup->__toString());
+ }
// Since Drupal 10.3 the image styles are rendered as webp.
- if (version_compare(\Drupal::VERSION, '10.3', '>=')) {
+ elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^
/', $markup->__toString());
}
else {
@@ -257,8 +277,12 @@ public function testRenderImageMedia() {
$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);
+ // Since Drupal 10.3 the image styles are rendered as avif.
+ if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
+ $this->assertMatchesRegularExpression('/^
/', $markup->__toString());
+ }
// Since Drupal 10.3 the image styles are rendered as webp.
- if (version_compare(\Drupal::VERSION, '10.3', '>=')) {
+ elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^
/', $markup->__toString());
}
else {