You are here

function ImageToolkitUnitTest::testResize in SimpleTest 7

Test the image_resize() function.

File

tests/image.test, line 112
Unit tests for the Drupal Form API.

Class

ImageToolkitUnitTest
Test that the functions in image.inc correctly pass data to the toolkit.

Code

function testResize() {
  $this
    ->assertTrue(image_resize($this->image, 1, 2), t('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, t('Width was passed correctly'));
  $this
    ->assertEqual($calls['resize'][0][2], 2, t('Height was passed correctly'));
}