public function ImageTest::testFloatResize in Drupal 9
Same name and namespace in other branches
- 8 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']);
}