function ImageEffectsTest::testScaleEffect
Same name in other branches
- 9 core/modules/image/tests/src/Kernel/ImageEffectsTest.php \Drupal\Tests\image\Kernel\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()
Test the image_scale_effect() function.
File
-
core/
modules/ image/ tests/ src/ Functional/ ImageEffectsTest.php, line 58
Class
- ImageEffectsTest
- Tests that the image effects pass parameters to the toolkit correctly.
Namespace
Drupal\Tests\image\FunctionalCode
public function testScaleEffect() {
// @todo: need to test upscaling.
$this->assertImageEffect('image_scale', [
'width' => 10,
'height' => 10,
]);
$this->assertToolkitOperationsCalled([
'scale',
]);
// Check the parameters.
$calls = $this->imageTestGetAllCalls();
$this->assertEqual($calls['scale'][0][0], 10, 'Width was passed correctly');
$this->assertEqual($calls['scale'][0][1], 10, 'Height was based off aspect ratio and passed correctly');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.