function ImageTest::testScaleSame

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

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

File

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

Class

ImageTest
Tests the image class.

Namespace

Drupal\Tests\Core\Image

Code

public function testScaleSame() : void {
  $this->getTestImageForOperation('Scale');
  // Dimensions are the same, resize should not be called.
  $this->toolkitOperation
    ->expects($this->once())
    ->method('execute')
    ->willReturnArgument(0);
  $ret = $this->image
    ->scale(88, 100, FALSE);
  $this->assertEquals(88, $ret['width']);
  $this->assertEquals(100, $ret['height']);
}

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