protected function configDecodeJsonSimple() { $codecBin = new Protobuf\Codec\Binary(); $codecJson = new Protobuf\Codec\Json(); $bin = $this->configDecodeBinarySimple(); $simple = $codecBin->decode(new test\Simple(), $bin[1]); $data = $codecJson->encode($simple); return array($codecJson, $data); }
function testMultiCodecMessageWithRepeatedFields() { $jsonCodec = new Codec\Json(); $repeated = Protobuf\Protobuf::decode(Repeated::class, $this->bin_repeated_nested); $json = $jsonCodec->encode($repeated); $repeated = $jsonCodec->decode(new Repeated(), $json); $bin = Protobuf\Protobuf::encode($repeated); $this->assertEquals($bin, $this->bin_repeated_nested); }