function ToolkitTest::testResize

Test the image_resize() function.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTest.php, line 54
Definition of Drupal\system\Tests\Image\ToolkitTest.

Class

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

Namespace

Drupal\system\Tests\Image

Code

function testResize() {
  $this
    ->assertTrue(image_resize($this->image, 1, 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');
}