function ToolkitTest::testRotate

Test the image_rotate() function.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTest.php, line 100
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 testRotate() {
  $this
    ->assertTrue(image_rotate($this->image, 90, 1), 'Function returned the expected value.');
  $this
    ->assertToolkitOperationsCalled(array(
    'rotate',
  ));

  // Check the parameters.
  $calls = $this
    ->imageTestGetAllCalls();
  $this
    ->assertEqual($calls['rotate'][0][1], 90, 'Degrees were passed correctly');
  $this
    ->assertEqual($calls['rotate'][0][2], 1, 'Background color was passed correctly');
}