You are here

public function ImageEffectsTest::testRotateEffect in Drupal 9

Tests the image_rotate_effect() function.

File

core/modules/image/tests/src/Kernel/ImageEffectsTest.php, line 178

Class

ImageEffectsTest
Tests image effects.

Namespace

Drupal\Tests\image\Kernel

Code

public function testRotateEffect() {

  // @todo Test also with 'random' === TRUE in #3040887.
  // @see https://www.drupal.org/project/drupal/issues/3040887
  $this
    ->assertImageEffect([
    'rotate',
  ], 'image_rotate', [
    'degrees' => 90,
    'bgcolor' => '#fff',
  ]);

  // Check the parameters.
  $calls = $this
    ->imageTestGetAllCalls();

  // Degrees were passed correctly.
  $this
    ->assertEquals(90, $calls['rotate'][0][0]);

  // Background color was passed correctly.
  $this
    ->assertEquals('#fff', $calls['rotate'][0][1]);
}