Tests for string methods without WKT.
This commit is contained in:
@@ -337,8 +337,10 @@
|
|||||||
|
|
||||||
function test_fromWKT_undefined(t) {
|
function test_fromWKT_undefined(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
|
|
||||||
var WKT = OpenLayers.Format.WKT;
|
var WKT = OpenLayers.Format.WKT;
|
||||||
OpenLayers.Format.WKT = null;
|
OpenLayers.Format.WKT = null;
|
||||||
|
delete OpenLayers.Geometry.fromWKT.format;
|
||||||
|
|
||||||
var geom = OpenLayers.Geometry.fromWKT("POINT(1 1)");
|
var geom = OpenLayers.Geometry.fromWKT("POINT(1 1)");
|
||||||
t.eq(geom, undefined, "undefined when OpenLayers.Format.WKT is not available");
|
t.eq(geom, undefined, "undefined when OpenLayers.Format.WKT is not available");
|
||||||
|
|||||||
@@ -102,6 +102,21 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_Point_toString_no_wkt(t) {
|
||||||
|
t.plan(1);
|
||||||
|
|
||||||
|
var WKT = OpenLayers.Format.WKT;
|
||||||
|
OpenLayers.Format.WKT = null;
|
||||||
|
|
||||||
|
var x = 10;
|
||||||
|
var y = 20;
|
||||||
|
point = new OpenLayers.Geometry.Point(x, y);
|
||||||
|
t.eq(point.toString(), "[object Object]", "default string representation");
|
||||||
|
|
||||||
|
OpenLayers.Format.WKT = WKT;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function test_Point_move(t) {
|
function test_Point_move(t) {
|
||||||
t.plan(3);
|
t.plan(3);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user