You are here

function ImageEffectsTest::testScaleAndCropEffect in Zircon Profile 8

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

Test the image_scale_and_crop_effect() function.

File

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

Class

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

Namespace

Drupal\image\Tests

Code

function testScaleAndCropEffect() {
  $this
    ->assertImageEffect('image_scale_and_crop', array(
    'width' => 5,
    'height' => 10,
  ));
  $this
    ->assertToolkitOperationsCalled(array(
    'scale_and_crop',
  ));

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