You are here

public function ImageUtilityTest::resizeDimensionsProvider 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::resizeDimensionsProvider()
  2. 8.2 tests/src/Unit/ImageUtilityTest.php \Drupal\Tests\image_effects\Unit\ImageUtilityTest::resizeDimensionsProvider()

Data provider for testResizeDimensions.

File

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

Class

ImageUtilityTest
Tests the image utility helper methods.

Namespace

Drupal\Tests\image_effects\Unit

Code

public function resizeDimensionsProvider() {
  return [
    // Square = FALSE.
    [
      NULL,
      100,
      50,
      25,
      FALSE,
      50,
      25,
    ],
    [
      200,
      NULL,
      50,
      25,
      FALSE,
      50,
      25,
    ],
    [
      NULL,
      NULL,
      50,
      25,
      FALSE,
      50,
      25,
    ],
    [
      200,
      100,
      50,
      25,
      FALSE,
      50,
      25,
    ],
    [
      NULL,
      100,
      '50%',
      '25%',
      FALSE,
      NULL,
      NULL,
    ],
    [
      200,
      NULL,
      '50%',
      '25%',
      FALSE,
      NULL,
      NULL,
    ],
    [
      NULL,
      NULL,
      '50%',
      '25%',
      FALSE,
      NULL,
      NULL,
    ],
    [
      200,
      100,
      '50%',
      '25%',
      FALSE,
      100,
      25,
    ],
    [
      200,
      100,
      '50%',
      '150%',
      FALSE,
      100,
      150,
    ],
    [
      200,
      100,
      '150%',
      '10%',
      FALSE,
      300,
      10,
    ],
    [
      NULL,
      100,
      '50',
      '25%',
      FALSE,
      50,
      25,
    ],
    [
      200,
      NULL,
      '50%',
      '25',
      FALSE,
      100,
      25,
    ],
    [
      200,
      100,
      '50%',
      NULL,
      FALSE,
      100,
      50,
    ],
    [
      200,
      100,
      NULL,
      '50%',
      FALSE,
      100,
      50,
    ],
    [
      40,
      20,
      '100%',
      0,
      FALSE,
      40,
      20,
    ],
    [
      40,
      20,
      0,
      '100%',
      FALSE,
      40,
      20,
    ],
    // Square = TRUE.
    [
      200,
      100,
      30,
      NULL,
      TRUE,
      30,
      30,
    ],
    [
      200,
      100,
      NULL,
      35,
      TRUE,
      35,
      35,
    ],
    [
      200,
      100,
      '50%',
      NULL,
      TRUE,
      100,
      100,
    ],
    [
      200,
      100,
      NULL,
      '50%',
      TRUE,
      50,
      50,
    ],
    [
      40,
      20,
      '100%',
      0,
      TRUE,
      40,
      40,
    ],
    [
      40,
      20,
      0,
      '100%',
      TRUE,
      20,
      20,
    ],
  ];
}