public function DmsConverterTest::dataProvider in Geofield 8
Data provider for testConverter.
Return value
array A list of equivalent DMS/Decimal coordinates.
File
- tests/
src/ Unit/ DmsConverterTest.php, line 35
Class
- DmsConverterTest
- @coversDefaultClass \Drupal\geofield\DmsConverter @group geofield
Namespace
Drupal\Tests\geofield\UnitCode
public function dataProvider() {
return [
'Simple' => [
new DmsPoint([
'orientation' => 'E',
'degrees' => 40,
'minutes' => 0,
'seconds' => 0,
], [
'orientation' => 'N',
'degrees' => 9,
'minutes' => 0,
'seconds' => 0,
]),
[
40,
9,
],
],
'Negative' => [
new DmsPoint([
'orientation' => 'W',
'degrees' => 40,
'minutes' => 0,
'seconds' => 0,
], [
'orientation' => 'S',
'degrees' => 9,
'minutes' => 0,
'seconds' => 0,
]),
[
-40,
-9,
],
],
'Decimal' => [
new DmsPoint([
'orientation' => 'W',
'degrees' => 3,
'minutes' => 3,
'seconds' => 3,
], [
'orientation' => 'S',
'degrees' => 2,
'minutes' => 2,
'seconds' => 2,
]),
[
-3.0508333333333333,
-2.033888888888889,
],
],
];
}