| | 44 | |
|---|
| | 45 | function test_Protocol_WFS_v1_0_0_update(t) { |
|---|
| | 46 | t.plan( 4 ); |
|---|
| | 47 | |
|---|
| | 48 | var protocol = new OpenLayers.Protocol.WFS.v1_0_0({ |
|---|
| | 49 | url: "http://sigma.openplans.org/geoserver/wfs", |
|---|
| | 50 | params: {typename: 'topp:tasmania_cities'} |
|---|
| | 51 | }); |
|---|
| | 52 | protocol.setFormat(new OpenLayers.Format.GML); |
|---|
| | 53 | |
|---|
| | 54 | |
|---|
| | 55 | var test_feature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(42, 7), {has : "cheeseburger"}); |
|---|
| | 56 | test_feature.layer = { |
|---|
| | 57 | projection: { |
|---|
| | 58 | getCode : function(){ |
|---|
| | 59 | return "EPSG:4326"; |
|---|
| | 60 | } |
|---|
| | 61 | } |
|---|
| | 62 | } |
|---|
| | 63 | test_feature.fid = "fid.7" |
|---|
| | 64 | |
|---|
| | 65 | var node = protocol.update(test_feature); |
|---|
| | 66 | |
|---|
| | 67 | t.ok(node,"Output of update is not null"); |
|---|
| | 68 | t.eq(node.nodeType, 1, "Output of update is a node of the proper type."); |
|---|
| | 69 | t.eq(node.tagName, "wfs:Update", "Tagname is totally the appropriate one. Dawwg."); |
|---|
| | 70 | t.eq(node.textContent, "the_geom42,7hascheeseburger", "The node created by update has the right textcontent."); |
|---|
| | 71 | |
|---|
| | 72 | |
|---|
| | 73 | |
|---|
| | 74 | } |
|---|
| | 75 | |
|---|