summaryrefslogtreecommitdiff
path: root/php/test
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2015-02-17 11:50:58 +0100
committerBenoit Foucher <benoit@zeroc.com>2015-02-17 11:50:58 +0100
commit67e9afa30c73daa260343d4c3638610f4c70980a (patch)
treeca5ba63f90d97e18f51238f3818294e3a5e3d3a4 /php/test
parentIceLocatorDiscovery Makefile fix (diff)
downloadice-67e9afa30c73daa260343d4c3638610f4c70980a.tar.bz2
ice-67e9afa30c73daa260343d4c3638610f4c70980a.tar.xz
ice-67e9afa30c73daa260343d4c3638610f4c70980a.zip
Fixed ICE-6269: tolerate null values for structs and enums
Diffstat (limited to 'php/test')
-rw-r--r--php/test/Ice/operations/Client.php12
-rw-r--r--php/test/Ice/optional/Client.php8
2 files changed, 17 insertions, 3 deletions
diff --git a/php/test/Ice/operations/Client.php b/php/test/Ice/operations/Client.php
index b6ced5a47f3..8d6f5d4cd36 100644
--- a/php/test/Ice/operations/Client.php
+++ b/php/test/Ice/operations/Client.php
@@ -255,6 +255,18 @@ function twoways($communicator, $p)
test($so->e == $enum3);
test($so->s->s == "a new string");
$so->p->opVoid();
+
+ // Test marshalling of null structs and structs with null members.
+ $si1 = $NS ? eval("return new Test\\Structure;") : eval("return new Test_Structure;");
+ $si2 = null;
+
+ $rso = $p->opStruct($si1, $si2, $so);
+ test($rso->p == null);
+ test($rso->e == $enum1);
+ test($rso->s->s == "");
+ test($so->p == null);
+ test($so->e == $enum1);
+ test($so->s->s == "a new string");
}
{
diff --git a/php/test/Ice/optional/Client.php b/php/test/Ice/optional/Client.php
index 4341015b9ca..a2567f1fec3 100644
--- a/php/test/Ice/optional/Client.php
+++ b/php/test/Ice/optional/Client.php
@@ -401,14 +401,14 @@ function allTests($communicator)
$fcls = $NS ? "Test\\F" : "Test_F";
$f = new $fcls;
-
+
$acls = $NS ? "Test\\A" : "Test_A";
$f->af = new $acls;
$f->ae = $f->af;
-
+
$rf = $initial->pingPong($f);
test($rf->ae == $rf->af);
-
+
echo "ok\n";
echo "testing optional with default values... ";
@@ -518,6 +518,8 @@ function allTests($communicator)
$p1 = new $sscls(56);
$p3 = $initial->opSmallStruct($p1, $p2);
test($p2 == $p1 && $p3 == $p1);
+ $p3 = $initial->opSmallStruct(null, $p2); // Testing null struct
+ test($p2->m == 0 && $p3->m == 0);
$p3 = $initial->opFixedStruct(Ice_Unset, $p2);
test($p2 == Ice_Unset && $p3 == Ice_Unset);