You are here

public function ImageTest::testResize in Drupal 10

Same name in this branch
  1. 10 core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testResize()
  2. 10 core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\ImageTest::testResize()
Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testResize()
  2. 9 core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testResize()

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

File

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

Class

ImageTest
Tests the image class.

Namespace

Drupal\Tests\Core\Image

Code

public function testResize() {
  $this
    ->getTestImageForOperation('Resize');
  $this->toolkitOperation
    ->expects($this
    ->once())
    ->method('execute')
    ->will($this
    ->returnArgument(0));

  // Resize with integer for width and height.
  $ret = $this->image
    ->resize(30, 40);
  $this
    ->assertEquals(30, $ret['width']);
  $this
    ->assertEquals(40, $ret['height']);
}