function ImageEffectsTest::testResizeEffect

Same name in other branches
  1. 9 core/modules/image/tests/src/Kernel/ImageEffectsTest.php \Drupal\Tests\image\Kernel\ImageEffectsTest::testResizeEffect()
  2. 8.9.x core/modules/image/tests/src/Functional/ImageEffectsTest.php \Drupal\Tests\image\Functional\ImageEffectsTest::testResizeEffect()
  3. 10 core/modules/image/tests/src/Kernel/ImageEffectsTest.php \Drupal\Tests\image\Kernel\ImageEffectsTest::testResizeEffect()

Tests the 'image_resize' effect.

File

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

Class

ImageEffectsTest
Tests image effects.

Namespace

Drupal\Tests\image\Kernel

Code

public function testResizeEffect() : void {
    $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]);
}

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