function ImageTest::testScaleHeight

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

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

File

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

Class

ImageTest
Tests the image class.

Namespace

Drupal\Tests\Core\Image

Code

public function testScaleHeight() : void {
    $this->getTestImageForOperation('Scale');
    $this->toolkitOperation
        ->expects($this->once())
        ->method('execute')
        ->willReturnArgument(0);
    $ret = $this->image
        ->scale(NULL, 50, FALSE);
    $this->assertEquals(44, $ret['width']);
}

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