More tests for scaleRow method

This commit is contained in:
Madhura Jayaratne 2011-08-24 09:58:00 +05:30
parent 936461597e
commit 98a770b415
3 changed files with 102 additions and 0 deletions

View File

@ -198,5 +198,39 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest
)
);
}
/**
* test scaleRow method
*
* @param string $spatial spatial data of a row
* @param array $min_max expected results
*
* @dataProvider providerForTestScaleRow
* @return nothing
*/
public function testScaleRow($spatial, $min_max)
{
$this->assertEquals($this->object->scaleRow($spatial), $min_max);
}
/**
* data provider for testScaleRow
*
* @return data for testScaleRow
*/
public function providerForTestScaleRow()
{
return array(
array(
'MULTILINESTRING((36 14,47 23,62 75),(36 10,17 23,178 53))',
array(
'minX' => 17,
'maxX' => 178,
'minY' => 10,
'maxY' => 75
)
)
);
}
}
?>

View File

@ -142,5 +142,39 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest
)
);
}
/**
* test scaleRow method
*
* @param string $spatial spatial data of a row
* @param array $min_max expected results
*
* @dataProvider providerForTestScaleRow
* @return nothing
*/
public function testScaleRow($spatial, $min_max)
{
$this->assertEquals($this->object->scaleRow($spatial), $min_max);
}
/**
* data provider for testScaleRow
*
* @return data for testScaleRow
*/
public function providerForTestScaleRow()
{
return array(
array(
'MULTIPOINT(12 35,48 75,69 23,25 45,14 53,35 78)',
array(
'minX' => 12,
'maxX' => 69,
'minY' => 23,
'maxY' => 78
)
)
);
}
}
?>

View File

@ -144,5 +144,39 @@ class PMA_GIS_PointTest extends PMA_GIS_GeomTest
)
);
}
/**
* test scaleRow method
*
* @param string $spatial spatial data of a row
* @param array $min_max expected results
*
* @dataProvider providerForTestScaleRow
* @return nothing
*/
public function testScaleRow($spatial, $min_max)
{
$this->assertEquals($this->object->scaleRow($spatial), $min_max);
}
/**
* data provider for testScaleRow
*
* @return data for testScaleRow
*/
public function providerForTestScaleRow()
{
return array(
array(
'POINT(12 35)',
array(
'minX' => 12,
'maxX' => 12,
'minY' => 35,
'maxY' => 35,
)
)
);
}
}
?>