function ImageEffectsTest::assertImageEffect

Asserts the effect processing of an image effect plugin.

Parameters

string $effect_name: The name of the image effect to test.

array $data: The data to pass to the image effect.

Return value

bool TRUE if the assertion succeeded, FALSE otherwise.

8 calls to ImageEffectsTest::assertImageEffect()
ImageEffectsTest::testConvertEffect in core/modules/image/tests/src/Functional/ImageEffectsTest.php
Tests the ConvertImageEffect plugin.
ImageEffectsTest::testCropEffect in core/modules/image/tests/src/Functional/ImageEffectsTest.php
Test the image_crop_effect() function.
ImageEffectsTest::testDesaturateEffect in core/modules/image/tests/src/Functional/ImageEffectsTest.php
Test the image_desaturate_effect() function.
ImageEffectsTest::testResizeEffect in core/modules/image/tests/src/Functional/ImageEffectsTest.php
Test the image_resize_effect() function.
ImageEffectsTest::testRotateEffect in core/modules/image/tests/src/Functional/ImageEffectsTest.php
Test the image_rotate_effect() function.

... See full list

File

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

Class

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

Namespace

Drupal\Tests\image\Functional

Code

protected function assertImageEffect($effect_name, array $data) {
    $effect = $this->manager
        ->createInstance($effect_name, [
        'data' => $data,
    ]);
    return $this->assertTrue($effect->applyEffect($this->image), 'Function returned the expected value.');
}

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