Fix some coding standard violations
This commit is contained in:
parent
26feda2eda
commit
0a4fa4a25a
@ -265,7 +265,8 @@ class PMA_GIS_GeometryTest extends PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function providerForTestGetBoundsForOl() {
|
||||
public function providerForTestGetBoundsForOl()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
@ -278,7 +279,7 @@ class PMA_GIS_GeometryTest extends PHPUnit_Framework_TestCase
|
||||
),
|
||||
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));'
|
||||
)
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -300,16 +301,16 @@ class PMA_GIS_GeometryTest extends PHPUnit_Framework_TestCase
|
||||
$output
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function providerForTestGetPolygonArrayForOpenLayers(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
array(
|
||||
array('Triangle'),
|
||||
4326,
|
||||
'new Array(new OpenLayers.Geometry.Polygon(new Array(new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(,)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))))'
|
||||
)
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -13,8 +13,11 @@ require_once 'libraries/tcpdf/tcpdf.php';
|
||||
|
||||
/**
|
||||
* Tests for PMA_GIS_Geometrycollection class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class PMA_GIS_Geometrycollection_test extends PHPUnit_Framework_TestCase {
|
||||
class PMA_GIS_Geometrycollection_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @access protected
|
||||
@ -28,7 +31,8 @@ class PMA_GIS_Geometrycollection_test extends PHPUnit_Framework_TestCase {
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = PMA_GIS_Geometrycollection::singleton();
|
||||
}
|
||||
|
||||
@ -39,22 +43,25 @@ class PMA_GIS_Geometrycollection_test extends PHPUnit_Framework_TestCase {
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown() {
|
||||
protected function tearDown()
|
||||
{
|
||||
unset($this->object);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
*
|
||||
* @param type $spatial
|
||||
*
|
||||
* @dataProvider providerForScaleRow
|
||||
*/
|
||||
public function testScaleRow($spatial, $output) {
|
||||
public function testScaleRow($spatial, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->scaleRow($spatial), $output);
|
||||
}
|
||||
|
||||
public function providerForScaleRow() {
|
||||
public function providerForScaleRow()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
@ -74,16 +81,18 @@ class PMA_GIS_Geometrycollection_test extends PHPUnit_Framework_TestCase {
|
||||
* @param type $gis_data
|
||||
* @param type $index
|
||||
* @param string $empty
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
* @dataProvider providerForGenerateWkt
|
||||
*/
|
||||
public function testGenerateWkt($gis_data, $index, $empty, $output) {
|
||||
public function testGenerateWkt($gis_data, $index, $empty, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->generateWkt($gis_data, $index, $empty = ''), $output);
|
||||
}
|
||||
|
||||
public function providerForGenerateWkt() {
|
||||
public function providerForGenerateWkt()
|
||||
{
|
||||
|
||||
$temp1 = array(
|
||||
0 => array(
|
||||
@ -112,12 +121,14 @@ class PMA_GIS_Geometrycollection_test extends PHPUnit_Framework_TestCase {
|
||||
*
|
||||
* @dataProvider providerForGenerateParams
|
||||
*/
|
||||
public function testGenerateParams($value, $output) {
|
||||
public function testGenerateParams($value, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->generateParams($value), $output);
|
||||
}
|
||||
|
||||
public function providerForGenerateParams() {
|
||||
public function providerForGenerateParams()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
@ -153,17 +164,19 @@ class PMA_GIS_Geometrycollection_test extends PHPUnit_Framework_TestCase {
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $image
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
* @dataProvider providerForPrepareRowAsPng
|
||||
*/
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output) {
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image);
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsPng() {
|
||||
public function providerForPrepareRowAsPng()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
@ -189,16 +202,18 @@ class PMA_GIS_Geometrycollection_test extends PHPUnit_Framework_TestCase {
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $pdf
|
||||
*
|
||||
*
|
||||
* @dataProvider providerForPrepareRowAsPdf
|
||||
*/
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) {
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf);
|
||||
$this->assertTrue($return instanceof TCPDF);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsPdf() {
|
||||
public function providerForPrepareRowAsPdf()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
@ -222,18 +237,20 @@ class PMA_GIS_Geometrycollection_test extends PHPUnit_Framework_TestCase {
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
* @dataProvider providerForPrepareRowAsSvg
|
||||
* @param type $output
|
||||
*
|
||||
* @dataProvider providerForPrepareRowAsSvg
|
||||
*/
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output) {
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$string = $this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data);
|
||||
$this->assertEquals(1, preg_match($output, $string));
|
||||
// $this->assertEquals($this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsSvg() {
|
||||
public function providerForPrepareRowAsSvg()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
@ -258,16 +275,18 @@ class PMA_GIS_Geometrycollection_test extends PHPUnit_Framework_TestCase {
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
* @dataProvider providerForPrepareRowAsOl
|
||||
*/
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output) {
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->prepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data), $output);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsOl() {
|
||||
public function providerForPrepareRowAsOl()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
|
||||
@ -162,7 +162,7 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
@ -170,18 +170,19 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $image
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPng
|
||||
*/
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output) {
|
||||
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image);
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPng(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
@ -196,7 +197,7 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest
|
||||
imagecreatetruecolor('120','150'),
|
||||
''
|
||||
)
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -207,17 +208,18 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $pdf
|
||||
*
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPdf
|
||||
*/
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) {
|
||||
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf);
|
||||
$this->assertTrue($return instanceof TCPDF);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPdf(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
@ -230,29 +232,30 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
new TCPDF(),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
*/
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$string = $this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data);
|
||||
$this->assertEquals(1, preg_match($output, $string));
|
||||
//$this->assertEquals($this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsSvg(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
@ -265,7 +268,7 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
'/^(<polyline points="0,218 72,138 114,242 26,198 4,182 46,132 " name="svg" id="svg)(\d+)(" class="linestring vector" fill="none" stroke="#B02EE0" stroke-width="2"\/>)$/'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -276,17 +279,18 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsOl
|
||||
*/
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->prepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsOl(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
@ -300,7 +304,7 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest
|
||||
'maxY' => '1',
|
||||
),
|
||||
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(new Array((new OpenLayers.Geometry.Point(12,35)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(48,75)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(69,23)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(25,45)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(14,53)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(35,78)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))), null, {"strokeColor":"#B02EE0","strokeWidth":2,"label":"Ol","fontSize":10}));'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -222,8 +222,8 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
@ -231,18 +231,19 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $image
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPng
|
||||
*/
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output) {
|
||||
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image);
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPng(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTILINESTRING((36 14,47 23,62 75),(36 10,17 23,178 53))',
|
||||
@ -257,7 +258,7 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest
|
||||
imagecreatetruecolor('120','150'),
|
||||
''
|
||||
)
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -268,17 +269,18 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $pdf
|
||||
*
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPdf
|
||||
*/
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) {
|
||||
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf);
|
||||
$this->assertTrue($return instanceof TCPDF);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPdf(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTILINESTRING((36 14,47 23,62 75),(36 10,17 23,178 53))',
|
||||
@ -291,29 +293,30 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
new TCPDF(),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
*/
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$string = $this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data);
|
||||
$this->assertEquals(1, preg_match($output, $string));
|
||||
//$this->assertEquals($this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsSvg(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTILINESTRING((36 14,47 23,62 75),(36 10,17 23,178 53))',
|
||||
@ -326,7 +329,7 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
'/^(<polyline points="48,260 70,242 100,138 " name="svg" class="linestring vector" fill="none" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/><polyline points="48,268 10,242 332,182 " name="svg" class="linestring vector" fill="none" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/>)$/'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -337,17 +340,18 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsOl
|
||||
*/
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->prepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsOl(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTILINESTRING((36 14,47 23,62 75),(36 10,17 23,178 53))',
|
||||
@ -361,7 +365,7 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest
|
||||
'maxY' => '1',
|
||||
),
|
||||
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(new Array(new OpenLayers.Geometry.LineString(new Array((new OpenLayers.Geometry.Point(36,14)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(47,23)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(62,75)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))), new OpenLayers.Geometry.LineString(new Array((new OpenLayers.Geometry.Point(36,10)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(17,23)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(178,53)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))), null, {"strokeColor":"#B02EE0","strokeWidth":2,"label":"Ol","fontSize":10}));'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,8 +166,8 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
@ -175,18 +175,19 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $image
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPng
|
||||
*/
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output) {
|
||||
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image);
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPng(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTIPOINT(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
@ -201,7 +202,7 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest
|
||||
imagecreatetruecolor('120','150'),
|
||||
''
|
||||
)
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -212,17 +213,18 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $pdf
|
||||
*
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPdf
|
||||
*/
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) {
|
||||
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf);
|
||||
$this->assertTrue($return instanceof TCPDF);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPdf(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTIPOINT(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
@ -235,29 +237,30 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
new TCPDF(),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
*/
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$string = $this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data);
|
||||
$this->assertEquals(1, preg_match($output, $string));
|
||||
// $this->assertEquals($this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsSvg(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTIPOINT(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
@ -270,7 +273,7 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
'/^(<circle cx="72" cy="138" r="3" name="svg" class="multipoint vector" fill="white" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/><circle cx="114" cy="242" r="3" name="svg" class="multipoint vector" fill="white" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/><circle cx="26" cy="198" r="3" name="svg" class="multipoint vector" fill="white" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/><circle cx="4" cy="182" r="3" name="svg" class="multipoint vector" fill="white" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/><circle cx="46" cy="132" r="3" name="svg" class="multipoint vector" fill="white" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/>)$/'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -281,17 +284,18 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsOl
|
||||
*/
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->prepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsOl(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTIPOINT(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
@ -305,7 +309,7 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest
|
||||
'maxY' => '1',
|
||||
),
|
||||
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(new Array((new OpenLayers.Geometry.Point(12,35)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(48,75)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(69,23)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(25,45)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(14,53)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(35,78)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))), null, {"pointRadius":3,"fillColor":"#ffffff","strokeColor":"#B02EE0","strokeWidth":2,"label":"Ol","labelYOffset":-8,"fontSize":10}));'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -260,8 +260,8 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeomTest
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
@ -269,18 +269,19 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $image
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPng
|
||||
*/
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output) {
|
||||
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image);
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPng(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTIPOLYGON(((136 40,147 83,16 75,136 40)),((105 0,56 20,78 73,105 0)))',
|
||||
@ -295,7 +296,7 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeomTest
|
||||
imagecreatetruecolor('120','150'),
|
||||
''
|
||||
)
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -306,17 +307,18 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $pdf
|
||||
*
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPdf
|
||||
*/
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) {
|
||||
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf);
|
||||
$this->assertTrue($return instanceof TCPDF);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPdf(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTIPOLYGON(((136 40,147 83,16 75,136 40)),((105 0,56 20,78 73,105 0)))',
|
||||
@ -329,29 +331,30 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
new TCPDF(),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
*/
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$string = $this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data);
|
||||
$this->assertEquals(1, preg_match($output, $string));
|
||||
// $this->assertEquals($this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsSvg(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTIPOLYGON(((136 40,147 83,16 75,136 40)),((105 0,56 20,78 73,105 0)))',
|
||||
@ -364,7 +367,7 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
'/^(<path d=" M 248, 208 L 270, 122 L 8, 138 Z " name="svg" class="multipolygon vector" stroke="black" stroke-width="0.5" fill="#B02EE0" fill-rule="evenodd" fill-opacity="0.8" id="svg)(\d+)("\/><path d=" M 186, 288 L 88, 248 L 132, 142 Z " name="svg" class="multipolygon vector" stroke="black" stroke-width="0.5" fill="#B02EE0" fill-rule="evenodd" fill-opacity="0.8" id="svg)(\d+)("\/>)$/'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -375,17 +378,18 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeomTest
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsOl
|
||||
*/
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->prepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsOl(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'MULTIPOLYGON(((136 40,147 83,16 75,136 40)),((105 0,56 20,78 73,105 0)))',
|
||||
@ -399,7 +403,7 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeomTest
|
||||
'maxY' => '1',
|
||||
),
|
||||
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(new Array(new OpenLayers.Geometry.Polygon(new Array(new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(136,40)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(147,83)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(16,75)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(136,40)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))), new OpenLayers.Geometry.Polygon(new Array(new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(105,0)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(56,20)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(78,73)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(105,0)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))))), null, {"strokeColor":"#000000","strokeWidth":0.5,"fillColor":"#B02EE0","fillOpacity":0.8,"label":"Ol","fontSize":10}));'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,8 +168,8 @@ class PMA_GIS_PointTest extends PMA_GIS_GeomTest
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
@ -177,18 +177,19 @@ class PMA_GIS_PointTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $image
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPng
|
||||
*/
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output) {
|
||||
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image);
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPng(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'POINT(12 35)',
|
||||
@ -203,7 +204,7 @@ class PMA_GIS_PointTest extends PMA_GIS_GeomTest
|
||||
imagecreatetruecolor('120','150'),
|
||||
''
|
||||
)
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -214,17 +215,18 @@ class PMA_GIS_PointTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $pdf
|
||||
*
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPdf
|
||||
*/
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) {
|
||||
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf);
|
||||
$this->assertTrue($return instanceof TCPDF);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPdf(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'POINT(12 35)',
|
||||
@ -237,28 +239,29 @@ class PMA_GIS_PointTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
new TCPDF(),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
*/
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($output, $this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data));
|
||||
// $this->assertEquals($this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsSvg(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'POINT(12 35)',
|
||||
@ -271,7 +274,7 @@ class PMA_GIS_PointTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
''
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -282,17 +285,18 @@ class PMA_GIS_PointTest extends PMA_GIS_GeomTest
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsOl
|
||||
*/
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->prepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsOl(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'POINT(12 35)',
|
||||
@ -306,7 +310,7 @@ class PMA_GIS_PointTest extends PMA_GIS_GeomTest
|
||||
'maxY' => '1',
|
||||
),
|
||||
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector((new OpenLayers.Geometry.Point(12,35)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), null, {"pointRadius":3,"fillColor":"#ffffff","strokeColor":"#B02EE0","strokeWidth":2,"label":"Ol","labelYOffset":-8,"fontSize":10}));'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,8 +348,8 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
@ -357,18 +357,19 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $image
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPng
|
||||
*/
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output) {
|
||||
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image);
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPng(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'POLYGON((123 0,23 30,17 63,123 0))',
|
||||
@ -383,7 +384,7 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest
|
||||
imagecreatetruecolor('120','150'),
|
||||
''
|
||||
)
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -394,17 +395,18 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $pdf
|
||||
*
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPdf
|
||||
*/
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf) {
|
||||
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf);
|
||||
$this->assertTrue($return instanceof TCPDF);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsPdf(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'POLYGON((123 0,23 30,17 63,123 0))',
|
||||
@ -417,29 +419,30 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
new TCPDF(),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
*/
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$string = $this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data);
|
||||
$this->assertEquals(1, preg_match($output, $string));
|
||||
// $this->assertEquals($this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsSvg(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'POLYGON((123 0,23 30,17 63,123 0))',
|
||||
@ -452,7 +455,7 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest
|
||||
'height' => 150
|
||||
),
|
||||
'/^(<path d=" M 222, 288 L 22, 228 L 10, 162 Z " name="svg" id="svg)(\d+)(" class="polygon vector" stroke="black" stroke-width="0.5" fill="#B02EE0" fill-rule="evenodd" fill-opacity="0.8"\/>)$/'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -463,17 +466,18 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsOl
|
||||
*/
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output) {
|
||||
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->prepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
|
||||
public function providerForPrepareRowAsOl(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
'POLYGON((123 0,23 30,17 63,123 0))',
|
||||
@ -487,24 +491,25 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest
|
||||
'maxY' => '1',
|
||||
),
|
||||
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(new Array(new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(123,0)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(23,30)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(17,63)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(123,0)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))), null, {"strokeColor":"#000000","strokeWidth":0.5,"fillColor":"#B02EE0","fillOpacity":0.8,"label":"Ol","fontSize":10}));'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $ring
|
||||
* @param type $output
|
||||
*
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForIsOuterRing
|
||||
*/
|
||||
public function testIsOuterRing($ring) {
|
||||
|
||||
public function testIsOuterRing($ring)
|
||||
{
|
||||
|
||||
$this->assertTrue($this->object->isOuterRing($ring));
|
||||
}
|
||||
|
||||
|
||||
public function providerForIsOuterRing(){
|
||||
|
||||
|
||||
return array(
|
||||
array(
|
||||
array(
|
||||
@ -513,7 +518,7 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest
|
||||
array('x' => 1, 'y' => 1),
|
||||
array('x' => 1, 'y' => 0)
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user