You are here

public function ImageUtilityTest::testResizeDimensions in Image Effects 8

Same name and namespace in other branches
  1. 8.3 tests/src/Unit/ImageUtilityTest.php \Drupal\Tests\image_effects\Unit\ImageUtilityTest::testResizeDimensions()
  2. 8.2 tests/src/Unit/ImageUtilityTest.php \Drupal\Tests\image_effects\Unit\ImageUtilityTest::testResizeDimensions()

@covers ::resizeDimensions @dataProvider resizeDimensionsProvider

File

tests/src/Unit/ImageUtilityTest.php, line 80

Class

ImageUtilityTest
Tests the image utility helper methods.

Namespace

Drupal\Tests\image_effects\Unit

Code

public function testResizeDimensions($source_width, $source_height, $width_specification, $height_specification, $square, $expected_width, $expected_height) {
  $result = ImageUtility::resizeDimensions($source_width, $source_height, $width_specification, $height_specification, $square);
  $this
    ->assertSame($expected_width, $result['width']);
  $this
    ->assertSame($expected_height, $result['height']);
}