diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2018-07-27 12:24:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-27 12:24:42 -0700 |
commit | 8705adc2289aca42b9ec54e0e9cdaf869beceb63 (patch) | |
tree | bf782efb97dc27f6d4d72b79be90fcf559a46178 /conformance/conformance_php.php | |
parent | bdcbcabe5e123067ad2474994df343d0458b63ea (diff) | |
download | protobuf-8705adc2289aca42b9ec54e0e9cdaf869beceb63.tar.gz protobuf-8705adc2289aca42b9ec54e0e9cdaf869beceb63.tar.bz2 protobuf-8705adc2289aca42b9ec54e0e9cdaf869beceb63.zip |
Give a specific category to each test. (#4965)
* Give a unique category to each test.
This change introduce a TestCategory enum to ConformanceRequest. Existing tests
are divided into three categories: binary format test, json format test and json
format (ignore unknown when parsing) test. For the previous two categories, there
is no change to existing testee programs. For tests with the last category, testee programs
should either enable ignoring unknown field during json parsing or skip the test.
* Fix python test
* Fix java
* Fix csharp
* Update document
* Update csharp generated code
Diffstat (limited to 'conformance/conformance_php.php')
-rwxr-xr-x | conformance/conformance_php.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/conformance/conformance_php.php b/conformance/conformance_php.php index 65483e27..799cc3e3 100755 --- a/conformance/conformance_php.php +++ b/conformance/conformance_php.php @@ -3,6 +3,7 @@ require_once("Conformance/WireFormat.php"); require_once("Conformance/ConformanceResponse.php"); require_once("Conformance/ConformanceRequest.php"); +require_once("Conformance/TestCategory.php"); require_once("Protobuf_test_messages/Proto3/ForeignMessage.php"); require_once("Protobuf_test_messages/Proto3/ForeignEnum.php"); require_once("Protobuf_test_messages/Proto3/TestAllTypesProto3.php"); @@ -12,6 +13,7 @@ require_once("Protobuf_test_messages/Proto3/TestAllTypesProto3/NestedEnum.php"); require_once("GPBMetadata/Conformance.php"); require_once("GPBMetadata/Google/Protobuf/TestMessagesProto3.php"); +use \Conformance\TestCategory; use \Conformance\WireFormat; if (!ini_get("date.timezone")) { @@ -39,7 +41,9 @@ function doTest($request) trigger_error("Protobuf request doesn't have specific payload type", E_USER_ERROR); } } elseif ($request->getPayload() == "json_payload") { - $ignore_json_unknown = $request->getIgnoreUnknownJson(); + $ignore_json_unknown = + ($request->getTestCategory() == + TestCategory::JSON_IGNORE_UNKNOWN_PARSING_TEST); try { $test_message->mergeFromJsonString($request->getJsonPayload(), $ignore_json_unknown); |