function ToolkitTest::testDesaturate

Test the image_desaturate() function.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTest.php, line 128
Definition of Drupal\system\Tests\Image\ToolkitTest.

Class

ToolkitTest
Test that the functions in image.inc correctly pass data to the toolkit.

Namespace

Drupal\system\Tests\Image

Code

function testDesaturate() {
  $this
    ->assertTrue(image_desaturate($this->image), 'Function returned the expected value.');
  $this
    ->assertToolkitOperationsCalled(array(
    'desaturate',
  ));

  // Check the parameters.
  $calls = $this
    ->imageTestGetAllCalls();
  $this
    ->assertEqual(count($calls['desaturate'][0]), 1, 'Only the image was passed.');
}