From 195352c403755551a558265729b9899a4dcf5927 Mon Sep 17 00:00:00 2001 From: Bart van den Eijnden Date: Wed, 21 Nov 2012 13:08:37 +0100 Subject: [PATCH] make sure we can have multiple feature ids in InsertResults --- lib/OpenLayers/Format/WFST/v1_0_0.js | 2 +- tests/Format/WFST/v1_0_0.html | 8 +++++--- tests/Format/WFST/v1_1_0.html | 10 +++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/OpenLayers/Format/WFST/v1_0_0.js b/lib/OpenLayers/Format/WFST/v1_0_0.js index 62f52c6a16..746d5b8c83 100644 --- a/lib/OpenLayers/Format/WFST/v1_0_0.js +++ b/lib/OpenLayers/Format/WFST/v1_0_0.js @@ -103,7 +103,7 @@ OpenLayers.Format.WFST.v1_0_0 = OpenLayers.Class( "InsertResult": function(node, container) { var obj = {fids: []}; this.readChildNodes(node, obj); - container.insertIds.push(obj.fids[0]); + container.insertIds = container.insertIds.concat(obj.fids); }, "TransactionResult": function(node, obj) { this.readChildNodes(node, obj); diff --git a/tests/Format/WFST/v1_0_0.html b/tests/Format/WFST/v1_0_0.html index 89d810e85e..a8fce797d3 100644 --- a/tests/Format/WFST/v1_0_0.html +++ b/tests/Format/WFST/v1_0_0.html @@ -11,7 +11,7 @@ } function test_read(t) { - t.plan(2); + t.plan(3); var data = readXML("Transaction_Response"); var format = new OpenLayers.Format.WFST.v1_0_0({ @@ -19,7 +19,8 @@ featureType: "states" }); var result = format.read(data); - t.eq(result.insertIds[0], "none", "InsertIds read correctly"); + t.eq(result.insertIds[0], "parcelle.40", "First InsertId read correctly"); + t.eq(result.insertIds[1], "parcelle.41", "Second InsertId read correctly"); t.eq(result.success, true, "Success read correctly"); } @@ -91,7 +92,8 @@