From: Bryan Duxbury Date: Fri, 4 Mar 2011 00:49:40 +0000 (+0000) Subject: THRIFT-1081. php: PHP tests broken and somewhat incomplete X-Git-Tag: 0.7.0~163 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=a971fb094877b4245142c45abe67fc4e5568af30;p=common%2Fthrift.git THRIFT-1081. php: PHP tests broken and somewhat incomplete This patch fixes some minor bugs and includes a test for Framed Transport. Patch: Nicholas Telford git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1076908 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/php/TestClient.php b/test/php/TestClient.php index 6a06367d..653b8650 100644 --- a/test/php/TestClient.php +++ b/test/php/TestClient.php @@ -1,3 +1,4 @@ +setDebug(TRUE); if ($MODE == 'inline') { $transport = $socket; $testClient = new ThriftTestClient($transport); +} else if ($MODE == 'framed') { + $framedSocket = new TFramedTransport($socket); + $transport = $framedSocket; + $protocol = new TBinaryProtocol($transport); + $testClient = new ThriftTestClient($protocol); } else { $bufferedSocket = new TBufferedTransport($socket, 1024, 1024); $transport = $bufferedSocket; @@ -317,7 +322,7 @@ foreach ($whoa as $key => $val) { print_r("$k2 => {"); $userMap = $v2->userMap; print_r("{"); - if (is_array($usermap)) { + if (is_array($userMap)) { foreach ($userMap as $k3 => $v3) { print_r("$k3 => $v3, "); } @@ -347,7 +352,7 @@ print_r("testException('Xception')"); try { $testClient->testException('Xception'); print_r(" void\nFAILURE\n"); -} catch (Xception $x) { +} catch (ThriftTest_Xception $x) { print_r(' caught xception '.$x->errorCode.': '.$x->message."\n"); } @@ -395,4 +400,3 @@ if ($num != $num2) { $transport->close(); return; -?>