Add the missing this.layername in TileCache constructor (in clone function), add a unit test for this function (Closes #1180)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5328 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2007-12-03 06:59:05 +00:00
parent 92f5a7d749
commit fec5d40fc7
2 changed files with 12 additions and 2 deletions

View File

@@ -71,8 +71,9 @@ OpenLayers.Layer.TileCache = OpenLayers.Class(OpenLayers.Layer.Grid, {
if (obj == null) {
obj = new OpenLayers.Layer.TileCache(this.name,
this.url,
this.options);
this.url,
this.layername,
this.options);
}
//get all additions from superclasses

View File

@@ -18,7 +18,16 @@
t.ok( layer instanceof OpenLayers.Layer.TileCache, "returns OpenLayers.Layer.TileCache object" );
}
function test__Layer_TileCache_clone(t) {
t.plan(3);
layer = new OpenLayers.Layer.TileCache(name, url, layername, options);
var clone = layer.clone();
t.eq(layer.name, clone.name, "clone() correctly copy the 'name' property");
t.eq(layer.url, clone.url, "clone() correctly copy the 'url' property");
t.eq(layer.layername, clone.layername, "clone() correctly copy the 'layername' property");
}
function test_03_Layer_TileCache_clearTiles (t) {
t.plan( 1 );