summaryrefslogtreecommitdiff
path: root/php/test
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2015-02-17 15:49:00 -0330
committerDwayne Boone <dwayne@zeroc.com>2015-02-17 15:49:00 -0330
commitbfb35f122ecb429cf9d869f0331b0899f7b18fe8 (patch)
treef72951c29ecd08d9f34b0c0da47e3056959444ad /php/test
parentFixed (ICE-5740) - IcePatch2 has issues with 'large' files. (diff)
downloadice-bfb35f122ecb429cf9d869f0331b0899f7b18fe8.tar.bz2
ice-bfb35f122ecb429cf9d869f0331b0899f7b18fe8.tar.xz
ice-bfb35f122ecb429cf9d869f0331b0899f7b18fe8.zip
ICE-6313 Add Python/Ruby/PHP support for WSEndpointInfo / WSConnectionInfo
Diffstat (limited to 'php/test')
-rw-r--r--php/test/Ice/info/Client.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/php/test/Ice/info/Client.php b/php/test/Ice/info/Client.php
index 46c800c3b33..1e9b275b064 100644
--- a/php/test/Ice/info/Client.php
+++ b/php/test/Ice/info/Client.php
@@ -40,6 +40,7 @@ function allTests($communicator)
$udpEndpointInfoClass = $NS ? "Ice\\UDPEndpointInfo" : "Ice_UDPEndpointInfo";
$sslEndpointType = 2;
$wsEndpointType = $NS ? constant("Ice\\WSEndpointType") : constant("Ice_WSEndpointType");
+ $wsEndpointInfoClass = $NS ? "Ice\\WSEndpointInfo" : "Ice_WSEndpointInfo";
$wssEndpointType = $NS ? constant("Ice\\WSSEndpointType") : constant("Ice_WSSEndpointType");
$protocolVersionClass = $NS ? "Ice\\ProtocolVersion" : "Ice_ProtocolVersion";
$encodingVersionClass = $NS ? "Ice\\EncodingVersion" : "Ice_EncodingVersion";
@@ -68,8 +69,8 @@ function allTests($communicator)
($ipEndpoint->type() == $wssEndpointType && $ipEndpoint->secure()));
test(($ipEndpoint->type() == $tcpEndpointType && ($ipEndpoint instanceof $tcpEndpointInfoClass)) ||
($ipEndpoint->type() == $sslEndpointType && ($ipEndpoint instanceof $ipEndpointInfoClass)) ||
- ($ipEndpoint->type() == $wsEndpointType && ($ipEndpoint instanceof $ipEndpointInfoClass)) ||
- ($ipEndpoint->type() == $wssEndpointType && ($ipEndpoint instanceof $ipEndpointInfoClass)));
+ ($ipEndpoint->type() == $wsEndpointType && ($ipEndpoint instanceof $wsEndpointInfoClass)) ||
+ ($ipEndpoint->type() == $wssEndpointType && ($ipEndpoint instanceof $wsEndpointInfoClass)));
$udpEndpoint = $endps[1]->getInfo();
test($udpEndpoint instanceof $udpEndpointInfoClass);
@@ -118,6 +119,7 @@ function allTests($communicator)
flush();
{
$ipConnectionInfoClass = $NS ? "Ice\\IPConnectionInfo" : "Ice_IPConnectionInfo";
+ $wsConnectionInfoClass = $NS ? "Ice\\WSConnectionInfo" : "Ice_WSConnectionInfo";
$info = $base->ice_getConnection()->getInfo();
test($info instanceof $ipConnectionInfoClass);
@@ -137,6 +139,22 @@ function allTests($communicator)
test($ctx["localAddress"] == $info->remoteAddress);
test($ctx["remotePort"] == $info->localPort);
test($ctx["localPort"] == $info->remotePort);
+
+ if($base->ice_getConnection()->type() == "ws" || $base->ice_getConnection()->type() == "wss")
+ {
+ test($info instanceof $wsConnectionInfoClass);
+
+ test($info->headers["Upgrade"] == "websocket");
+ test($info->headers["Connection"] == "Upgrade");
+ test($info->headers["Sec-WebSocket-Protocol"] == "ice.zeroc.com");
+ test(isset($info->headers["Sec-WebSocket-Accept"]));
+
+ test($ctx["ws.Upgrade"] == "websocket");
+ test($ctx["ws.Connection"] == "Upgrade");
+ test($ctx["ws.Sec-WebSocket-Protocol"] == "ice.zeroc.com");
+ test($ctx["ws.Sec-WebSocket-Version"] == "13");
+ test(isset($ctx["ws.Sec-WebSocket-Key"]));
+ }
}
echo "ok\n";