You are here

public function FocalPointEffectsTest::constrainCropAreaProvider in Focal Point 8

Data provider for testConstrainCropArea().

See also

FocalPointEffectsTest::testConstrainCropArea()

File

tests/src/Unit/Effects/FocalPointEffectsTest.php, line 194

Class

FocalPointEffectsTest
Tests the Focal Point image effects.

Namespace

Drupal\Tests\focal_point\Unit\Effects

Code

public function constrainCropAreaProvider() {
  $data = [];

  // @codingStandardsIgnoreStart
  $data['constrained-top-left'] = [
    [
      'x' => -10,
      'y' => -10,
    ],
    [
      'width' => 1000,
      'height' => 1000,
    ],
    [
      'width' => 100,
      'height' => 100,
    ],
    [
      'x' => 0,
      'y' => 0,
    ],
  ];
  $data['constrained-top-center'] = [
    [
      'x' => 10,
      'y' => -10,
    ],
    [
      'width' => 1000,
      'height' => 1000,
    ],
    [
      'width' => 100,
      'height' => 100,
    ],
    [
      'x' => 10,
      'y' => 0,
    ],
  ];
  $data['constrained-top-right'] = [
    [
      'x' => 2000,
      'y' => -10,
    ],
    [
      'width' => 1000,
      'height' => 1000,
    ],
    [
      'width' => 100,
      'height' => 100,
    ],
    [
      'x' => 900,
      'y' => 0,
    ],
  ];
  $data['constrained-center-left'] = [
    [
      'x' => -10,
      'y' => 313,
    ],
    [
      'width' => 1000,
      'height' => 1000,
    ],
    [
      'width' => 100,
      'height' => 100,
    ],
    [
      'x' => 0,
      'y' => 313,
    ],
  ];
  $data['unconstrained'] = [
    [
      'x' => 500,
      'y' => 500,
    ],
    [
      'width' => 1000,
      'height' => 1000,
    ],
    [
      'width' => 100,
      'height' => 100,
    ],
    [
      'x' => 500,
      'y' => 500,
    ],
  ];
  $data['constrained-center-right'] = [
    [
      'x' => 3000,
      'y' => 313,
    ],
    [
      'width' => 1000,
      'height' => 1000,
    ],
    [
      'width' => 100,
      'height' => 100,
    ],
    [
      'x' => 900,
      'y' => 313,
    ],
  ];
  $data['constrained-bottom-left'] = [
    [
      'x' => -10,
      'y' => 2000,
    ],
    [
      'width' => 1000,
      'height' => 1000,
    ],
    [
      'width' => 100,
      'height' => 100,
    ],
    [
      'x' => 0,
      'y' => 900,
    ],
  ];
  $data['constrained-bottom-center'] = [
    [
      'x' => 313,
      'y' => 2000,
    ],
    [
      'width' => 1000,
      'height' => 1000,
    ],
    [
      'width' => 100,
      'height' => 100,
    ],
    [
      'x' => 313,
      'y' => 900,
    ],
  ];
  $data['constrained-bottom-right'] = [
    [
      'x' => 3000,
      'y' => 2000,
    ],
    [
      'width' => 1000,
      'height' => 1000,
    ],
    [
      'width' => 100,
      'height' => 100,
    ],
    [
      'x' => 900,
      'y' => 900,
    ],
  ];

  // @codingStandardsIgnoreEnd
  return $data;
}