function ImageTest::testFloatResize
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testFloatResize()
- 10 core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testFloatResize()
- 11.x core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testFloatResize()
Tests \Drupal\Core\Image\Image::resize().
File
-
core/
tests/ Drupal/ Tests/ Core/ Image/ ImageTest.php, line 445
Class
- ImageTest
- Tests the image class.
Namespace
Drupal\Tests\Core\ImageCode
public function testFloatResize() {
$this->getTestImageForOperation('Resize');
$this->toolkitOperation
->expects($this->once())
->method('execute')
->will($this->returnArgument(0));
// Pass a float for width.
$ret = $this->image
->resize(30.4, 40);
// Ensure that the float was rounded to an integer first.
$this->assertEquals(30, $ret['width']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.