evaluation of else filter in SLD. r=tschaub (closes #1317)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5978 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2008-02-03 17:48:19 +00:00
parent a664b6b390
commit 1faf641806
5 changed files with 96 additions and 28 deletions

View File

@@ -87,6 +87,33 @@
createdStyle = style.createStyle(feature);
t.eq(createdStyle.fillColor, baseStyle.fillColor, "Correct style for rule that does not apply to fid=\"2\".");
}
function test_Style_createStyle(t) {
t.plan(2);
var style = new OpenLayers.Style();
var rule = new OpenLayers.Rule({
id: Math.random()
});
var elseRule = new OpenLayers.Rule({
id: Math.random(),
elseFilter: true
});
style.addRules([rule, elseRule]);
// test that applySymbolizer is only called with rule
style.applySymbolizer = function(r) {
t.eq(r.id, rule.id, "(plain) applySymbolizer called with correct rule");
}
style.createStyle(new OpenLayers.Feature.Vector());
rule.evaluate = function() {return false;};
style.applySymbolizer = function(r) {
t.eq(r.id, elseRule.id, "(else) applySymbolizer called with correct rule");
}
style.createStyle(new OpenLayers.Feature.Vector());
}
function test_Style_destroy(t) {
t.plan(1);