More tests for scaleRow method
This commit is contained in:
parent
936461597e
commit
98a770b415
@ -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
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -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
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -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,
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user