function ImageEffectsTest::testRotateEffect

Test the image_rotate_effect() function.

File

drupal/core/modules/image/lib/Drupal/image/Tests/ImageEffectsTest.php, line 112
Definition of Drupal\image\Tests\ImageEffectsTest.

Class

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

Namespace

Drupal\image\Tests

Code

function testRotateEffect() {

  // @todo: need to test with 'random' => TRUE
  $this
    ->assertTrue(image_rotate_effect($this->image, array(
    'degrees' => 90,
    'bgcolor' => '#fff',
  )), 'Function returned the expected value.');
  $this
    ->assertToolkitOperationsCalled(array(
    'rotate',
  ));

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