diff options
author | Mark Spruiell <mes@zeroc.com> | 2014-07-23 16:49:37 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2014-07-23 16:49:37 -0700 |
commit | 771644c88e34713961ae998ddac507553af5cddb (patch) | |
tree | 95f404c423571069b9f790e0f7e70b681677c777 /php/test | |
parent | Merge branch 'master' of ssh://git.zeroc.com/home/git/ice (diff) | |
download | ice-771644c88e34713961ae998ddac507553af5cddb.tar.bz2 ice-771644c88e34713961ae998ddac507553af5cddb.tar.xz ice-771644c88e34713961ae998ddac507553af5cddb.zip |
ICE-5515 - proxy support for ice_staticId
Diffstat (limited to 'php/test')
-rw-r--r-- | php/test/Ice/facets/Client.php | 45 | ||||
-rw-r--r-- | php/test/Ice/operations/Client.php | 15 |
2 files changed, 53 insertions, 7 deletions
diff --git a/php/test/Ice/facets/Client.php b/php/test/Ice/facets/Client.php index cacfcd3f048..431736ee751 100644 --- a/php/test/Ice/facets/Client.php +++ b/php/test/Ice/facets/Client.php @@ -31,6 +31,8 @@ function test($b) function allTests($communicator) { + global $NS; + echo "testing stringToProxy... "; flush(); $ref = "d:default -p 12010"; @@ -38,12 +40,47 @@ function allTests($communicator) test($db != null); echo "ok\n"; + $objectHelper = $NS ? "Ice\\ObjectPrxHelper" : "Ice_ObjectPrxHelper"; + $dHelper = $NS ? "Test\\DPrxHelper" : "Test_DPrxHelper"; + + echo "testing unchecked cast... "; + flush(); + $prx = $objectHelper::uncheckedCast($db); + test($prx->ice_getFacet() == ""); + $prx = $objectHelper::uncheckedCast($db, "facetABCD"); + test($prx->ice_getFacet() == "facetABCD"); + $prx2 = $objectHelper::uncheckedCast($prx); + test($prx2->ice_getFacet() == "facetABCD"); + $prx3 = $objectHelper::uncheckedCast($prx, ""); + test($prx3->ice_getFacet() == ""); + $d = $dHelper::uncheckedCast($db); + test($d->ice_getFacet() == ""); + $df = $dHelper::uncheckedCast($db, "facetABCD"); + test($df->ice_getFacet() == "facetABCD"); + $df2 = $dHelper::uncheckedCast($df); + test($df2->ice_getFacet() == "facetABCD"); + $df3 = $dHelper::uncheckedCast($df, ""); + test($df3->ice_getFacet() == ""); + echo "ok\n"; + echo "testing checked cast... "; flush(); - $d = $db->ice_checkedCast("::Test::D"); - test($d != null); - test($d == $db); - test($db->ice_checkedCast("::Test::D", "bogus") == null); + $prx = $objectHelper::checkedCast($db); + test($prx->ice_getFacet() == ""); + $prx = $objectHelper::checkedCast($db, "facetABCD"); + test($prx->ice_getFacet() == "facetABCD"); + $prx2 = $objectHelper::checkedCast($prx); + test($prx2->ice_getFacet() == "facetABCD"); + $prx3 = $objectHelper::checkedCast($prx, ""); + test($prx3->ice_getFacet() == ""); + $d = $dHelper::checkedCast($db); + test($d->ice_getFacet() == ""); + $df = $dHelper::checkedCast($db, "facetABCD"); + test($df->ice_getFacet() == "facetABCD"); + $df2 = $dHelper::checkedCast($df); + test($df2->ice_getFacet() == "facetABCD"); + $df3 = $dHelper::checkedCast($df, ""); + test($df3->ice_getFacet() == ""); echo "ok\n"; echo "testing non-facets A, B, C, and D... "; diff --git a/php/test/Ice/operations/Client.php b/php/test/Ice/operations/Client.php index 6a71e960724..a7a4933565b 100644 --- a/php/test/Ice/operations/Client.php +++ b/php/test/Ice/operations/Client.php @@ -37,17 +37,26 @@ function twoways($communicator, $p) $enum2 = $NS ? constant("Test\\MyEnum::enum2") : constant("Test_MyEnum::enum2"); $enum3 = $NS ? constant("Test\\MyEnum::enum3") : constant("Test_MyEnum::enum3"); + $myDerivedClassPrxHelper = $NS ? "Test\\MyDerivedClassPrxHelper" : "Test_MyDerivedClassPrxHelper"; + $myDerivedClass = $NS ? "Test\\MyDerivedClass" : "Test_MyDerivedClass"; + $myClass = $NS ? "Test\\MyClass" : "Test_MyClass"; + $objectPrxHelper = $NS ? "Ice\\ObjectPrxHelper" : "Ice_ObjectPrxHelper"; + { $p->ice_ping(); } { - test(Test_MyDerivedClassPrxHelper::ice_staticId() == Test_MyDerivedClass::ice_staticId()); + test($myDerivedClassPrxHelper::ice_staticId() == $myDerivedClass::ice_staticId()); + test($objectPrxHelper::ice_staticId() == "::Ice::Object"); + } + + { + test($p->ice_isA($myClass::ice_staticId())); } - { - test($p->ice_isA("::Test::MyClass")); + test($p->ice_id() == $myDerivedClass::ice_staticId()); } { |