You are here

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

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

File

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

Class

ImageTest
Tests the image class.

Namespace

Drupal\Tests\Core\Image

Code

public function testScaleAndCropFails() {
  $this
    ->getTestImageForOperation('ScaleAndCrop');
  $this->toolkitOperation
    ->expects($this
    ->once())
    ->method('execute')
    ->will($this
    ->returnArgument(0));
  $ret = $this->image
    ->scaleAndCrop(44, 40);
  $this
    ->assertEquals(0, $ret['x']);
  $this
    ->assertEquals(5, $ret['y']);
  $this
    ->assertEquals(44, $ret['resize']['width']);
  $this
    ->assertEquals(50, $ret['resize']['height']);
}