From 17f7b2feab49766da3a836062ed9be03a6047bf1 Mon Sep 17 00:00:00 2001 From: Bart van den Eijnden Date: Mon, 5 Mar 2012 10:04:15 +0100 Subject: [PATCH] use separate testcase as suggested by @ahocevar --- tests/Control/WMSGetFeatureInfo.html | 33 +++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/tests/Control/WMSGetFeatureInfo.html b/tests/Control/WMSGetFeatureInfo.html index e7575fa163..b5e6d5db80 100644 --- a/tests/Control/WMSGetFeatureInfo.html +++ b/tests/Control/WMSGetFeatureInfo.html @@ -475,8 +475,37 @@ } + function test_exceptions(t) { + t.plan(1); + var map = new OpenLayers.Map("map", { + getExtent: function() {return(new OpenLayers.Bounds(-180,-90,180,90));} + } + ); + + var a = new OpenLayers.Layer.WMS("dummy","http://myhost/wms", { + layers: "x", + exceptions: "text/xml" + }); + + map.addLayer(a); + + var click = new OpenLayers.Control.WMSGetFeatureInfo({ + }); + + map.addControl(click); + + var _request = OpenLayers.Request.GET; + OpenLayers.Request.GET = function(options) { + t.eq(options.params["EXCEPTIONS"], "text/xml", "Exceptions parameter taken from the WMS layer if provided"); + }; + click.activate(); + click.getInfoForClick({xy: {x: 50, y: 50}}); + OpenLayers.Request.GET = _request; + map.destroy(); + } + function test_drillDown(t) { - t.plan(7); + t.plan(6); var map = new OpenLayers.Map("map", { getExtent: function() {return(new OpenLayers.Bounds(-180,-90,180,90));} } @@ -493,7 +522,6 @@ // this service does not support application/vnd.ogc.gml for GetFeatureInfo, only text/xml var c = new OpenLayers.Layer.WMS("dummy","http://myhost/wms", { layers: "x", - exceptions: "text/xml", info_format: "text/xml" }); @@ -516,7 +544,6 @@ t.eq(options.url, "http://localhost/wms", "Correct url used for second request"); } else if (count == 1) { t.eq(options.params["INFO_FORMAT"], "text/xml", "Overridden info format is used instead of the control's infoFormat"); - t.eq(options.params["EXCEPTIONS"], "text/xml", "Exceptions parameter is used from the WMS layer"); t.eq(options.url, "http://myhost/wms", "Correct url used for first request"); } };