function ToolkitTest::testFailingOperation

Same name in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php \Drupal\KernelTests\Core\Image\ToolkitTest::testFailingOperation()

Tests calling a failing image operation plugin.

File

core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php, line 139

Class

ToolkitTest
Tests the image toolkit.

Namespace

Drupal\KernelTests\Core\Image

Code

public function testFailingOperation() : void {
    $this->assertFalse($this->image
        ->apply('failing'));
    // Check that apply was called and with the correct parameters.
    $this->assertToolkitOperationsCalled([
        'apply',
    ]);
    $calls = $this->imageTestGetAllCalls();
    $this->assertEquals('failing', $calls['apply'][0][0]);
    $this->assertSame([], $calls['apply'][0][1]);
}

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