aboutsummaryrefslogtreecommitdiffhomepage
path: root/conformance/conformance_php.php
diff options
context:
space:
mode:
Diffstat (limited to 'conformance/conformance_php.php')
-rwxr-xr-xconformance/conformance_php.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/conformance/conformance_php.php b/conformance/conformance_php.php
index 20fb5082..848cb4c7 100755
--- a/conformance/conformance_php.php
+++ b/conformance/conformance_php.php
@@ -45,11 +45,18 @@ function doTest($request)
$test_message = new \Protobuf_test_messages\Proto3\TestAllTypes();
$response = new \Conformance\ConformanceResponse();
if ($request->getPayload() == "protobuf_payload") {
- try {
+ if ($request->getMessageType() == "proto3") {
+ try {
$test_message->mergeFromString($request->getProtobufPayload());
- } catch (Exception $e) {
+ } catch (Exception $e) {
$response->setParseError($e->getMessage());
return $response;
+ }
+ } elseif ($request->getMessageType() == "proto2") {
+ $response->setSkipped("PHP doesn't support proto2");
+ return $response;
+ } else {
+ trigger_error("Protobuf request doesn't have specific payload type", E_USER_ERROR);
}
} elseif ($request->getPayload() == "json_payload") {
try {