More test data

This commit is contained in:
Madhura Jayaratne 2011-08-22 20:43:50 +05:30
parent 9cda17487c
commit a7e48cde10
3 changed files with 75 additions and 2 deletions

View File

@ -72,6 +72,12 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeometryTest
$temp1 = $temp;
unset($temp1[0]['MULTILINESTRING'][1][1]['y']);
$temp2 = $temp;
$temp2[0]['MULTILINESTRING']['no_of_lines'] = 0;
$temp3 = $temp;
$temp3[0]['MULTILINESTRING'][1]['no_of_points'] = 1;
return array(
array(
$temp,
@ -99,7 +105,21 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeometryTest
0,
'0',
'MULTILINESTRING((5.02 8.45,6.14 0.15),(1.23 4.25,9.15 0))'
)
),
// atleast one line should be there
array(
$temp1,
0,
null,
'MULTILINESTRING((5.02 8.45,6.14 0.15)))'
),
// a line should have atleast two points
array(
$temp1,
0,
'0',
'MULTILINESTRING((5.02 8.45,6.14 0.15),(1.23 4.25,9.15 0.47))'
),
);
}

View File

@ -92,6 +92,15 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeometryTest
0 => $this->_getData()
);
$temp1 = $temp;
$temp1[0]['MULTIPOLYGON']['no_of_polygons'] = 0;
$temp2 = $temp;
$temp2[0]['MULTIPOLYGON'][1]['no_of_lines'] = 0;
$temp3 = $temp;
$temp3[0]['MULTIPOLYGON'][1][0]['no_of_points'] = 3;
return array(
array(
$temp,
@ -100,6 +109,30 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeometryTest
'MULTIPOLYGON(((35 10,10 20,15 40,45 45,35 10)'
. ',(20 30,35 32,30 20,20 30)),((123 0,23 30,17 63,123 0)))'
),
// at lease one polygon should be there
array(
$temp1,
0,
null,
'MULTIPOLYGON(((35 10,10 20,15 40,45 45,35 10)'
. ',(20 30,35 32,30 20,20 30)))'
),
// a polygon should have atleast one ring
array(
$temp2,
0,
null,
'MULTIPOLYGON(((35 10,10 20,15 40,45 45,35 10)'
. ',(20 30,35 32,30 20,20 30)),((123 0,23 30,17 63,123 0)))'
),
// a ring should have atleast four points
array(
$temp3,
0,
'0',
'MULTIPOLYGON(((35 10,10 20,15 40,45 45,35 10)'
. ',(20 30,35 32,30 20,20 30)),((123 0,23 30,17 63,123 0)))'
),
);
}

View File

@ -82,6 +82,12 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeometryTest
$temp1 = $temp;
unset($temp1[0]['POLYGON'][1][3]['y']);
$temp2 = $temp;
$temp2[0]['POLYGON']['no_of_lines'] = 0;
$temp3 = $temp;
$temp3[0]['POLYGON'][1]['no_of_points'] = 3;
return array(
array(
$temp,
@ -109,7 +115,21 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeometryTest
0,
'0',
'POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 32,30 20,20 0))'
)
),
// should have atleast one ring
array(
$temp2,
0,
'0',
'POLYGON((35 10,10 20,15 40,45 45,35 10))'
),
// a ring should have atleast four points
array(
$temp3,
0,
'0',
'POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 32,30 20,20 30))'
),
);
}