function ImageEffectsUnitTest::testResizeEffect

7.x image.test ImageEffectsUnitTest::testResizeEffect()

Test the image_resize_effect() function.

File

drupal-7.x/modules/image/image.test, line 352
Tests for image.module.

Class

ImageEffectsUnitTest
Use the image_test.module's mock toolkit to ensure that the effects are properly passing parameters to the image toolkit.

Code

function testResizeEffect() {
  $this->assertTrue(image_resize_effect($this->image, array('width' => 1, 'height' => 2)), 'Function returned the expected value.');
  $this->assertToolkitOperationsCalled(array('resize'));

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