function Tests_20120702::testMethods in geoPHP 7
Same name and namespace in other branches
- 8 geoPHP/tests/tests/20120702Test.php \Tests_20120702::testMethods()
File
- geoPHP/
tests/ tests/ 20120702Test.php, line 9
Class
Code
function testMethods() {
$format = 'gpx';
$value = file_get_contents('./input/20120702.gpx');
$geometry = geoPHP::load($value, $format);
$methods = array(
array(
'name' => 'area',
),
array(
'name' => 'boundary',
),
array(
'name' => 'getBBox',
),
array(
'name' => 'centroid',
),
array(
'name' => 'length',
),
array(
'name' => 'greatCircleLength',
'argument' => 6378137,
),
array(
'name' => 'haversineLength',
),
array(
'name' => 'y',
),
array(
'name' => 'x',
),
array(
'name' => 'numGeometries',
),
array(
'name' => 'geometryN',
'argument' => '1',
),
array(
'name' => 'startPoint',
),
array(
'name' => 'endPoint',
),
array(
'name' => 'isRing',
),
array(
'name' => 'isClosed',
),
array(
'name' => 'numPoints',
),
array(
'name' => 'pointN',
'argument' => '1',
),
array(
'name' => 'exteriorRing',
),
array(
'name' => 'numInteriorRings',
),
array(
'name' => 'interiorRingN',
'argument' => '1',
),
array(
'name' => 'dimension',
),
array(
'name' => 'geometryType',
),
array(
'name' => 'SRID',
),
array(
'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);
}
}