MCPcopy Create free account
hub / github.com/apache/avro / testRecordNullField

Method testRecordNullField

lang/php/test/IODatumReaderTest.php:72–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 }
71
72 public function testRecordNullField()
73 {
74 $schema_json = <<<_JSON
75{"name":"member",
76 "type":"record",
77 "fields":[{"name":"one", "type":"int"},
78 {"name":"two", "type":["null", "string"]}
79 ]}
80_JSON;
81
82 $schema = AvroSchema::parse($schema_json);
83 $datum = array("one" => 1);
84
85 $io = new AvroStringIO();
86 $writer = new AvroIODatumWriter($schema);
87 $encoder = new AvroIOBinaryEncoder($io);
88 $writer->write($datum, $encoder);
89 $bin = $io->string();
90
91 $this->assertSame('0200', bin2hex($bin));
92 }
93
94 public function testRecordFieldWithDefault()
95 {

Callers

nothing calls this directly

Calls 3

parseMethod · 0.65
writeMethod · 0.65
stringMethod · 0.45

Tested by

no test coverage detected