function ImageEffectsTest::testConvertAvifEffect

Tests the 'image_convert_avif' effect when avif is supported.

File

core/modules/image/tests/src/Kernel/ImageEffectsTest.php, line 125

Class

ImageEffectsTest
Tests image effects.

Namespace

Drupal\Tests\image\Kernel

Code

public function testConvertAvifEffect() : void {
  $this->container
    ->get('keyvalue')
    ->get('image_test')
    ->set('avif_enabled', TRUE);
  $this->assertImageEffect([
    'convert',
  ], 'image_convert_avif', [
    'extension' => 'webp',
  ]);
  $calls = $this->imageTestGetAllCalls();
  $this->assertEquals('avif', $calls['convert'][0][0]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.