You are here

public function ImageTest::testSaveFails in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testSaveFails()
  2. 9 core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testSaveFails()

Tests \Drupal\Core\Image\Image::save().

File

core/tests/Drupal/Tests/Core/Image/ImageTest.php, line 238

Class

ImageTest
Tests the image class.

Namespace

Drupal\Tests\Core\Image

Code

public function testSaveFails() {
  $this
    ->getTestImage();

  // This will fail if save() method isn't called on the toolkit.
  $this->toolkit
    ->expects($this
    ->once())
    ->method('save')
    ->will($this
    ->returnValue(FALSE));
  $this
    ->assertFalse($this->image
    ->save());
}