summaryrefslogtreecommitdiff
path: root/php/test
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-07-30 12:45:29 +0200
committerJose <jose@zeroc.com>2019-07-31 13:13:40 +0200
commit3e71d9e1a29bc8169452b039bb723406ff8ef0fe (patch)
treecfde39529b1a21d6f4c4e87b2a92a366eafc9993 /php/test
parentUpdate .npmignore to ignore .tgz files (diff)
downloadice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.tar.bz2
ice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.tar.xz
ice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.zip
Fixes for C++ & Swift generated code - Close #458
Diffstat (limited to 'php/test')
-rw-r--r--php/test/Ice/scope/Client.php12
-rw-r--r--php/test/Ice/scope/Test.ice35
2 files changed, 46 insertions, 1 deletions
diff --git a/php/test/Ice/scope/Client.php b/php/test/Ice/scope/Client.php
index d97cd6b5695..703799eeab9 100644
--- a/php/test/Ice/scope/Client.php
+++ b/php/test/Ice/scope/Client.php
@@ -32,6 +32,16 @@ function allTests($helper)
$smap3 = $i->opSMap($smap1, $smap2);
test($smap2["a"] == $s1);
test($smap3["a"] == $s1);
+
+ $v1 = $NS ? constant("Test\\E1::v1") : constant("Test_E1::v1");
+ $e = $i->opE1($v1);
+ test($e == $v1);
+
+ $s = $i->opS1($NS ? eval("return new Test\\S1(\"S1\");") : eval("return new Test_S1(\"S1\");"));
+ test($s->s == "S1");
+
+ $c = $i->opC1($NS ? eval("return new Test\\C1(\"C1\");") : eval("return new Test_C1(\"C1\");"));
+ test($c->s == "C1");
}
{
@@ -119,7 +129,7 @@ class Client extends TestHelper
{
try
{
- echo "test same Slice type name in different scopes... ";
+ echo "test using same type name in different Slice modules... ";
flush();
$communicator = $this->initialize($args);
allTests($this);
diff --git a/php/test/Ice/scope/Test.ice b/php/test/Ice/scope/Test.ice
index e2197329562..011badcf15b 100644
--- a/php/test/Ice/scope/Test.ice
+++ b/php/test/Ice/scope/Test.ice
@@ -22,6 +22,37 @@ module Test
dictionary<string, C> CMap;
sequence<C> CSeq;
+ enum E1
+ {
+ v1,
+ v2,
+ v3
+ }
+
+ struct S1
+ {
+ string s;
+ }
+
+ class C1
+ {
+ string s;
+ }
+
+ struct S2
+ {
+ E1 E1;
+ S1 S1;
+ C1 C1;
+ }
+
+ class C2
+ {
+ E1 E1;
+ S1 S1;
+ C1 C1;
+ }
+
interface I
{
S opS(S s1, out S s2);
@@ -32,6 +63,10 @@ module Test
CSeq opCSeq(CSeq s1, out CSeq s2);
CMap opCMap(CMap c1, out CMap c2);
+ E1 opE1(E1 E1);
+ S1 opS1(S1 S1);
+ C1 opC1(C1 C1);
+
void shutdown();
}