OpenLayers OpenLayers

Changeset 7109

Show
Ignore:
Timestamp:
05/08/08 13:25:55 (5 months ago)
Author:
sbenthall
Message:

Test for WFS protocol.commit

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/vector-behavior/tests/Protocol/WFS/v1_0_0.html

    r7090 r7109  
    9595        t.eq(node.tagName, "wfs:Delete", "Tagname is totally the appropriate one.  Dawwg."); 
    9696        t.eq(node.firstChild.firstChild.attributes.fid.nodeValue, "fid.7", "The right fid is stored in an attribute as expected."); 
    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    } 
    98127 
    99128  </script>