You are here

function ImageEffectsTest::testRotateEffect 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::testRotateEffect()

Test the image_rotate_effect() function.

File

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

Class

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

Namespace

Drupal\image\Tests

Code

function testRotateEffect() {

  // @todo: need to test with 'random' => TRUE
  $this
    ->assertImageEffect('image_rotate', array(
    'degrees' => 90,
    'bgcolor' => '#fff',
  ));
  $this
    ->assertToolkitOperationsCalled(array(
    'rotate',
  ));

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