| 97 | | } |
|---|
| | 97 | } |
|---|
| | 98 | |
|---|
| | 99 | function test_Protocol_WFS_v1_0_0_commit(t){ |
|---|
| | 100 | t.plan(2); |
|---|
| | 101 | |
|---|
| | 102 | var protocol = new OpenLayers.Protocol.WFS.v1_0_0({ |
|---|
| | 103 | url: "http://sigma.openplans.org/geoserver/wfs", |
|---|
| | 104 | params: {typename: 'topp:tasmania_cities'} |
|---|
| | 105 | }); |
|---|
| | 106 | protocol.setFormat(new OpenLayers.Format.GML); |
|---|
| | 107 | |
|---|
| | 108 | old_OpenLayers_Request_POST = OpenLayers.Request.POST; |
|---|
| | 109 | |
|---|
| | 110 | OpenLayers.Request.POST = function(object){ |
|---|
| | 111 | return object; |
|---|
| | 112 | } |
|---|
| | 113 | |
|---|
| | 114 | var object = protocol.commit() |
|---|
| | 115 | |
|---|
| | 116 | t.eq(request.url, "http://sigma.openplans.org/geoserver/wfs", "Request url is correct.") |
|---|
| | 117 | |
|---|
| | 118 | t.eq(request.params.SERVICE, "WFS","Default params make it to read request.") |
|---|
| | 119 | t.eq(request.params.typename, "topp:tasmania_cities","Params passed in to constructor make it to read request.") |
|---|
| | 120 | t.eq(request.params.bbox, [1,2,3,4],"Params passed in to read() as arguments make it to the read request.") |
|---|
| | 121 | |
|---|
| | 122 | |
|---|
| | 123 | OpenLayers.Request.POST = old_OpenLayers_Request_POST; |
|---|
| | 124 | |
|---|
| | 125 | |
|---|
| | 126 | } |
|---|