public function Tests_20120702::testMethods in geoPHP 8
Same name and namespace in other branches
- 7 geoPHP/tests/tests/20120702Test.php \Tests_20120702::testMethods()
File
- geoPHP/
tests/ tests/ 20120702Test.php, line 20
Class
Code
public function testMethods() {
$format = 'gpx';
$value = file_get_contents('./input/20120702.gpx');
$geometry = geoPHP::load($value, $format);
$methods = [
[
'name' => 'area',
],
[
'name' => 'boundary',
],
[
'name' => 'getBBox',
],
[
'name' => 'centroid',
],
[
'name' => 'length',
],
[
'name' => 'greatCircleLength',
'argument' => 6378137,
],
[
'name' => 'haversineLength',
],
[
'name' => 'y',
],
[
'name' => 'x',
],
[
'name' => 'numGeometries',
],
[
'name' => 'geometryN',
'argument' => '1',
],
[
'name' => 'startPoint',
],
[
'name' => 'endPoint',
],
[
'name' => 'isRing',
],
[
'name' => 'isClosed',
],
[
'name' => 'numPoints',
],
[
'name' => 'pointN',
'argument' => '1',
],
[
'name' => 'exteriorRing',
],
[
'name' => 'numInteriorRings',
],
[
'name' => 'interiorRingN',
'argument' => '1',
],
[
'name' => 'dimension',
],
[
'name' => 'geometryType',
],
[
'name' => 'SRID',
],
[
'name' => 'setSRID',
'argument' => '4326',
],
];
foreach ($methods as $method) {
$argument = NULL;
$method_name = $method['name'];
if (isset($method['argument'])) {
$argument = $method['argument'];
}
$this
->_methods_tester($geometry, $method_name, $argument);
}
}