public function FocalPointManagerTest::providerCoordinates in Focal Point 8
Data provider for testRelativeToAbsolute() and absoluteToRelative().
File
- tests/
src/ Unit/ FocalPointManagerTest.php, line 104
Class
- FocalPointManagerTest
- @coversDefaultClass \Drupal\focal_point\FocalPointManager
Namespace
Drupal\Tests\focal_point\UnitCode
public function providerCoordinates() {
$data = [];
$data['top_left'] = [
[
'x' => 0,
'y' => 0,
],
[
'width' => 1000,
'height' => 2000,
],
[
'x' => 0,
'y' => 0,
],
];
$data['basic_case_1'] = [
[
'x' => 25,
'y' => 50,
],
[
'width' => 1000,
'height' => 2000,
],
[
'x' => 250,
'y' => 1000,
],
];
$data['basic_case_2'] = [
[
'x' => 50,
'y' => 25,
],
[
'width' => 1000,
'height' => 2000,
],
[
'x' => 500,
'y' => 500,
],
];
$data['basic_case_3'] = [
[
'x' => 50,
'y' => 50,
],
[
'width' => 1000,
'height' => 2000,
],
[
'x' => 500,
'y' => 1000,
],
];
$data['basic_case_4'] = [
[
'x' => 75,
'y' => 50,
],
[
'width' => 1000,
'height' => 2000,
],
[
'x' => 750,
'y' => 1000,
],
];
$data['basic_case_5'] = [
[
'x' => 100,
'y' => 75,
],
[
'width' => 1000,
'height' => 2000,
],
[
'x' => 1000,
'y' => 1500,
],
];
$data['bottom_right'] = [
[
'x' => 100,
'y' => 100,
],
[
'width' => 1000,
'height' => 2000,
],
[
'x' => 1000,
'y' => 2000,
],
];
return $data;
}