function ImageTest::testScaleAndCropHeight

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testScaleAndCropHeight()
  2. 8.9.x core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testScaleAndCropHeight()
  3. 11.x core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testScaleAndCropHeight()

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

File

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

Class

ImageTest
Tests the image class.

Namespace

Drupal\Tests\Core\Image

Code

public function testScaleAndCropHeight() : void {
    $this->getTestImageForOperation('ScaleAndCrop');
    $this->toolkitOperation
        ->expects($this->once())
        ->method('execute')
        ->willReturnArgument(0);
    $ret = $this->image
        ->scaleAndCrop(44, 40);
    $this->assertEquals(5, $ret['y']);
}

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