You are here

public function ImageEffectsTest::testResizeEffect in Drupal 9

Tests the 'image_resize' effect.

File

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

Class

ImageEffectsTest
Tests image effects.

Namespace

Drupal\Tests\image\Kernel

Code

public function testResizeEffect() {
  $this
    ->assertImageEffect([
    'resize',
  ], 'image_resize', [
    'width' => 1,
    'height' => 2,
  ]);

  // Check the parameters.
  $calls = $this
    ->imageTestGetAllCalls();

  // Width was passed correctly.
  $this
    ->assertEquals(1, $calls['resize'][0][0]);

  // Height was passed correctly.
  $this
    ->assertEquals(2, $calls['resize'][0][1]);
}