add support for OpenLayers.Filter.Comparison.IS_NULL in OpenLayers.Format.CQL

This commit is contained in:
Bart van den Eijnden
2012-11-05 13:21:51 +01:00
parent 8bb58e453b
commit 41ac2dea08
2 changed files with 29 additions and 5 deletions

View File

@@ -281,6 +281,20 @@ function test_BETWEEN(t) {
}
function test_NULL(t) {
t.plan(3);
var filter = new OpenLayers.Filter.Comparison({
property: "GEOM",
type: "NULL"
});
var format = new OpenLayers.Format.CQL();
var str = 'GEOM IS NULL';
t.eq(format.write(filter), str, "NULL filter written correctly");
filter = format.read(str);
t.eq(filter.type, OpenLayers.Filter.Comparison.IS_NULL, "filter type is correctly parsed");
t.eq(filter.property, "GEOM", "filter property is correctly parsed");
}
</script>
</head>
<body></body>