Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
585b24e9
Unverified
Commit
585b24e9
authored
Aug 13, 2018
by
Joshua Haberman
Committed by
GitHub
Aug 13, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5032 from TeBoring/json-wrapper
Fix json parsing of wrapper values
parents
ba8692fb
e3ee7167
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
36 deletions
+81
-36
failure_list_php_c.txt
conformance/failure_list_php_c.txt
+0
-36
upb.c
php/ext/google/protobuf/upb.c
+0
-0
encode_decode_test.php
php/tests/encode_decode_test.php
+81
-0
No files found.
conformance/failure_list_php_c.txt
View file @
585b24e9
...
...
@@ -63,44 +63,8 @@ Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput
Required.Proto3.JsonInput.FloatFieldNan.JsonOutput
Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput
Required.Proto3.JsonInput.OneofFieldDuplicate
Required.Proto3.JsonInput.OptionalBoolWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalBoolWrapper.ProtobufOutput
Required.Proto3.JsonInput.OptionalBytesWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalBytesWrapper.ProtobufOutput
Required.Proto3.JsonInput.OptionalDoubleWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalDoubleWrapper.ProtobufOutput
Required.Proto3.JsonInput.OptionalFloatWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalFloatWrapper.ProtobufOutput
Required.Proto3.JsonInput.OptionalInt32Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalInt32Wrapper.ProtobufOutput
Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalInt64Wrapper.ProtobufOutput
Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalStringWrapper.ProtobufOutput
Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalUint32Wrapper.ProtobufOutput
Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalUint64Wrapper.ProtobufOutput
Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput
Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput
Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedBoolWrapper.ProtobufOutput
Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedBytesWrapper.ProtobufOutput
Required.Proto3.JsonInput.RepeatedDoubleWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedDoubleWrapper.ProtobufOutput
Required.Proto3.JsonInput.RepeatedFloatWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedFloatWrapper.ProtobufOutput
Required.Proto3.JsonInput.RepeatedInt32Wrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedInt32Wrapper.ProtobufOutput
Required.Proto3.JsonInput.RepeatedInt64Wrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedInt64Wrapper.ProtobufOutput
Required.Proto3.JsonInput.RepeatedStringWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedStringWrapper.ProtobufOutput
Required.Proto3.JsonInput.RepeatedUint32Wrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedUint32Wrapper.ProtobufOutput
Required.Proto3.JsonInput.RepeatedUint64Wrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedUint64Wrapper.ProtobufOutput
Required.Proto3.JsonInput.StringFieldEscape.JsonOutput
Required.Proto3.JsonInput.StringFieldEscape.ProtobufOutput
Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput
...
...
php/ext/google/protobuf/upb.c
View file @
585b24e9
This diff is collapsed.
Click to expand it.
php/tests/encode_decode_test.php
View file @
585b24e9
...
...
@@ -11,9 +11,90 @@ use Foo\TestMessage\Sub;
use
Foo\TestPackedMessage
;
use
Foo\TestRandomFieldOrder
;
use
Foo\TestUnpackedMessage
;
use
Google\Protobuf\DoubleValue
;
use
Google\Protobuf\FloatValue
;
use
Google\Protobuf\Int32Value
;
use
Google\Protobuf\UInt32Value
;
use
Google\Protobuf\Int64Value
;
use
Google\Protobuf\UInt64Value
;
use
Google\Protobuf\BoolValue
;
use
Google\Protobuf\StringValue
;
use
Google\Protobuf\BytesValue
;
class
EncodeDecodeTest
extends
TestBase
{
public
function
testDecodeJsonSimple
()
{
$m
=
new
TestMessage
();
$m
->
mergeFromJsonString
(
"
{
\"optionalInt32\":1
}
"
);
}
public
function
testDecodeTopLevelBoolValue
()
{
$m
=
new
BoolValue
();
$m
->
mergeFromJsonString
(
"true"
);
$this
->
assertEquals
(
true
,
$m
->
getValue
());
$m
->
mergeFromJsonString
(
"false"
);
$this
->
assertEquals
(
false
,
$m
->
getValue
());
}
public
function
testDecodeTopLevelDoubleValue
()
{
$m
=
new
DoubleValue
();
$m
->
mergeFromJsonString
(
"1.5"
);
$this
->
assertEquals
(
1.5
,
$m
->
getValue
());
}
public
function
testDecodeTopLevelFloatValue
()
{
$m
=
new
FloatValue
();
$m
->
mergeFromJsonString
(
"1.5"
);
$this
->
assertEquals
(
1.5
,
$m
->
getValue
());
}
public
function
testDecodeTopLevelInt32Value
()
{
$m
=
new
Int32Value
();
$m
->
mergeFromJsonString
(
"1"
);
$this
->
assertEquals
(
1
,
$m
->
getValue
());
}
public
function
testDecodeTopLevelUInt32Value
()
{
$m
=
new
UInt32Value
();
$m
->
mergeFromJsonString
(
"1"
);
$this
->
assertEquals
(
1
,
$m
->
getValue
());
}
public
function
testDecodeTopLevelInt64Value
()
{
$m
=
new
Int64Value
();
$m
->
mergeFromJsonString
(
"1"
);
$this
->
assertEquals
(
1
,
$m
->
getValue
());
}
public
function
testDecodeTopLevelUInt64Value
()
{
$m
=
new
UInt64Value
();
$m
->
mergeFromJsonString
(
"1"
);
$this
->
assertEquals
(
1
,
$m
->
getValue
());
}
public
function
testDecodeTopLevelStringValue
()
{
$m
=
new
StringValue
();
$m
->
mergeFromJsonString
(
"
\"
a
\"
"
);
$this
->
assertSame
(
"a"
,
$m
->
getValue
());
}
public
function
testDecodeTopLevelBytesValue
()
{
$m
=
new
BytesValue
();
$m
->
mergeFromJsonString
(
"
\"
YQ==
\"
"
);
$this
->
assertSame
(
"a"
,
$m
->
getValue
());
}
public
function
testEncode
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment