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. 10 core/modules/image/tests/src/Kernel/ImageEffectsTest.php \Drupal\Tests\image\Kernel\ImageEffectsTest::testRotateEffect()
  3. 11.x core/modules/image/tests/src/Kernel/ImageEffectsTest.php \Drupal\Tests\image\Kernel\ImageEffectsTest::testRotateEffect()

Test the image_rotate_effect() function.

File

core/modules/image/tests/src/Functional/ImageEffectsTest.php, line 159

Class

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

Namespace

Drupal\Tests\image\Functional

Code

public function testRotateEffect() {
    // @todo: need to test with 'random' => TRUE
    $this->assertImageEffect('image_rotate', [
        'degrees' => 90,
        'bgcolor' => '#fff',
    ]);
    $this->assertToolkitOperationsCalled([
        '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');
}

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