You are here

public function ImageTest::testParseFileFails 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::testParseFileFails()
  2. 9 core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testParseFileFails()

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

File

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

Class

ImageTest
Tests the image class.

Namespace

Drupal\Tests\Core\Image

Code

public function testParseFileFails() {
  $toolkit = $this
    ->getToolkitMock();
  $image = new Image($toolkit, 'magic-foobars.png');
  $this
    ->assertFalse($image
    ->isValid());
  $this
    ->assertFalse($image
    ->save());
}