summaryrefslogtreecommitdiff
path: root/php/test
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-06-16 16:12:59 +0200
committerJose <jose@zeroc.com>2015-06-16 16:12:59 +0200
commit0fe91035e5d1f074c011a9489d9113cea8f17008 (patch)
tree5155aa107a49696407bc5c5a190899275bd7c9f6 /php/test
parentFixed ICE-6594: IceGrid/replication test failure (diff)
downloadice-0fe91035e5d1f074c011a9489d9113cea8f17008.tar.bz2
ice-0fe91035e5d1f074c011a9489d9113cea8f17008.tar.xz
ice-0fe91035e5d1f074c011a9489d9113cea8f17008.zip
Fixed ICE-6602: optionals marshaling bug
Diffstat (limited to 'php/test')
-rw-r--r--php/test/Ice/optional/Client.php16
-rw-r--r--php/test/Ice/optional/Test.ice20
2 files changed, 36 insertions, 0 deletions
diff --git a/php/test/Ice/optional/Client.php b/php/test/Ice/optional/Client.php
index a2567f1fec3..39666ff7b13 100644
--- a/php/test/Ice/optional/Client.php
+++ b/php/test/Ice/optional/Client.php
@@ -337,6 +337,22 @@ function allTests($communicator)
test($oo != Ice_Unset);
$initial->ice_encodingVersion($Ice_Encoding_1_0)->returnOptionalClass(true, $oo);
test($oo == Ice_Unset);
+
+
+ $gcls = $NS ? "Test\\G" : "Test_G";
+ $g1cls = $NS ? "Test\\G1" : "Test_G1";
+ $g2cls = $NS ? "Test\\G2" : "Test_G2";
+
+ $g = new $gcls;
+ $g->gg1Opt = new $g1cls("gg1Opt");
+ $g->gg2 = new $g2cls(10);
+ $g->gg2Opt = new $g2cls(20);
+ $g->gg1 = new $g1cls("gg1");
+ $r = $initial->opG($g);
+ test($r->gg1Opt->a == "gg1Opt");
+ test($r->gg2->a == 10);
+ test($r->gg2Opt->a == 20);
+ test($r->gg1->a == "gg1");
echo "ok\n";
diff --git a/php/test/Ice/optional/Test.ice b/php/test/Ice/optional/Test.ice
index 40b5727a70e..d4a93f33410 100644
--- a/php/test/Ice/optional/Test.ice
+++ b/php/test/Ice/optional/Test.ice
@@ -171,6 +171,24 @@ class F extends E
optional(1) A af;
};
+class G1
+{
+ string a;
+};
+
+class G2
+{
+ long a;
+};
+
+class G
+{
+ optional(1) G1 gg1Opt;
+ G2 gg2;
+ optional(0) G2 gg2Opt;
+ G1 gg1;
+};
+
class Initial
{
void shutdown();
@@ -251,6 +269,8 @@ class Initial
void sendOptionalClass(bool req, optional(1) OneOptional o);
void returnOptionalClass(bool req, out optional(1) OneOptional o);
+
+ G opG(G g);
bool supportsRequiredParams();