aboutsummaryrefslogtreecommitdiff
path: root/conformance/conformance_php.php
diff options
context:
space:
mode:
authorYilun Chong <chongyilun250@sina.com>2017-06-30 17:38:50 -0700
committerGitHub <noreply@github.com>2017-06-30 17:38:50 -0700
commite82ba0b8026eb16c40ceba861f02c643c36e8232 (patch)
tree2aa89a917c6091923682221026507aa9eea1aba4 /conformance/conformance_php.php
parent726ba33d98cd06c268f88b7dedf2a9a7916d978d (diff)
parentecca6ea95d56a6f70ff7b223ec3f904758acc8b1 (diff)
downloadprotobuf-e82ba0b8026eb16c40ceba861f02c643c36e8232.tar.gz
protobuf-e82ba0b8026eb16c40ceba861f02c643c36e8232.tar.bz2
protobuf-e82ba0b8026eb16c40ceba861f02c643c36e8232.zip
Merge branch 'master' into ConformanceTestYilunChong
Diffstat (limited to 'conformance/conformance_php.php')
-rwxr-xr-xconformance/conformance_php.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/conformance/conformance_php.php b/conformance/conformance_php.php
index c1bd9bed..b6e12c01 100755
--- a/conformance/conformance_php.php
+++ b/conformance/conformance_php.php
@@ -60,7 +60,7 @@ function doTest($request)
}
} elseif ($request->getPayload() == "json_payload") {
try {
- $test_message->jsonDecode($request->getJsonPayload());
+ $test_message->mergeFromJsonString($request->getJsonPayload());
} catch (Exception $e) {
$response->setParseError($e->getMessage());
return $response;
@@ -74,7 +74,7 @@ function doTest($request)
} elseif ($request->getRequestedOutputFormat() == WireFormat::PROTOBUF) {
$response->setProtobufPayload($test_message->serializeToString());
} elseif ($request->getRequestedOutputFormat() == WireFormat::JSON) {
- $response->setJsonPayload($test_message->jsonEncode());
+ $response->setJsonPayload($test_message->serializeToJsonString());
}
return $response;
@@ -86,7 +86,8 @@ function doTestIO()
if (strlen($length_bytes) == 0) {
return false; # EOF
} elseif (strlen($length_bytes) != 4) {
- trigger_error("I/O error", E_USER_ERROR);
+ fwrite(STDERR, "I/O error\n");
+ return false;
}
$length = unpack("V", $length_bytes)[1];