function ImageEffectsTest::testConvertEffect

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

Tests the ConvertImageEffect plugin.

File

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

Class

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

Namespace

Drupal\Tests\image\Functional

Code

public function testConvertEffect() {
    // Test jpeg.
    $this->assertImageEffect('image_convert', [
        'extension' => 'jpeg',
    ]);
    $this->assertToolkitOperationsCalled([
        'convert',
    ]);
    // Check the parameters.
    $calls = $this->imageTestGetAllCalls();
    $this->assertEqual($calls['convert'][0][0], 'jpeg', 'Extension was passed correctly');
}

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