function ImageEffectsTest::testRotateEffect

Same name in other branches
  1. 9 core/modules/image/tests/src/Kernel/ImageEffectsTest.php \Drupal\Tests\image\Kernel\ImageEffectsTest::testRotateEffect()
  2. 8.9.x core/modules/image/tests/src/Functional/ImageEffectsTest.php \Drupal\Tests\image\Functional\ImageEffectsTest::testRotateEffect()
  3. 10 core/modules/image/tests/src/Kernel/ImageEffectsTest.php \Drupal\Tests\image\Kernel\ImageEffectsTest::testRotateEffect()

Tests the image_rotate_effect() function.

File

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

Class

ImageEffectsTest
Tests image effects.

Namespace

Drupal\Tests\image\Kernel

Code

public function testRotateEffect() : void {
    // @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]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.