You are here

function ImageEffectsTest::testResizeEffect in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/image/src/Tests/ImageEffectsTest.php \Drupal\image\Tests\ImageEffectsTest::testResizeEffect()

Test the image_resize_effect() function.

File

core/modules/image/src/Tests/ImageEffectsTest.php, line 41
Contains \Drupal\image\Tests\ImageEffectsTest.

Class

ImageEffectsTest
Tests that the image effects pass parameters to the toolkit correctly.

Namespace

Drupal\image\Tests

Code

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

  // Check the parameters.
  $calls = $this
    ->imageTestGetAllCalls();
  $this
    ->assertEqual($calls['resize'][0][0], 1, 'Width was passed correctly');
  $this
    ->assertEqual($calls['resize'][0][1], 2, 'Height was passed correctly');
}