function ImageTest::testCrop

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

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

File

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

Class

ImageTest
Tests the image class.

Namespace

Drupal\Tests\Core\Image

Code

public function testCrop() : void {
    $this->getTestImageForOperation('Crop');
    $this->toolkitOperation
        ->expects($this->once())
        ->method('execute')
        ->willReturnArgument(0);
    $ret = $this->image
        ->crop(0, 0, 44, 50);
    $this->assertEquals(44, $ret['width']);
}

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