function ImageTest::testSaveFails

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testSaveFails()
  2. 8.9.x core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testSaveFails()
  3. 10 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 242

Class

ImageTest
Tests the image class.

Namespace

Drupal\Tests\Core\Image

Code

public function testSaveFails() : void {
    $this->getTestImage();
    // This will fail if save() method isn't called on the toolkit.
    $this->toolkit
        ->expects($this->once())
        ->method('save')
        ->willReturn(FALSE);
    $this->assertFalse($this->image
        ->save());
}

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