function ImageEffectsTest::testScaleEffect
Same name in other branches
- 8.9.x core/modules/image/tests/src/Functional/ImageEffectsTest.php \Drupal\Tests\image\Functional\ImageEffectsTest::testScaleEffect()
- 10 core/modules/image/tests/src/Kernel/ImageEffectsTest.php \Drupal\Tests\image\Kernel\ImageEffectsTest::testScaleEffect()
- 11.x core/modules/image/tests/src/Kernel/ImageEffectsTest.php \Drupal\Tests\image\Kernel\ImageEffectsTest::testScaleEffect()
Tests the 'image_scale' effect.
File
-
core/
modules/ image/ tests/ src/ Kernel/ ImageEffectsTest.php, line 65
Class
- ImageEffectsTest
- Tests image effects.
Namespace
Drupal\Tests\image\KernelCode
public function testScaleEffect() {
// @todo Test also image upscaling in #3040887.
// @see https://www.drupal.org/project/drupal/issues/3040887
$this->assertImageEffect([
'scale',
], 'image_scale', [
'width' => 10,
'height' => 10,
]);
// Check the parameters.
$calls = $this->imageTestGetAllCalls();
// Width was passed correctly.
$this->assertEquals(10, $calls['scale'][0][0]);
// Height was based off aspect ratio and passed correctly.
$this->assertEquals(10, $calls['scale'][0][1]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.