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

Method test_write_read_null_round_trip

lang/php/test/DataFileTest.php:68–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66 }
67
68 public function test_write_read_null_round_trip()
69 {
70 foreach (AvroDataIO::validCodecs() as $codec) {
71 if (
72 ($codec === AvroDataIO::SNAPPY_CODEC && !extension_loaded('snappy'))
73 || ($codec === AvroDataIO::ZSTANDARD_CODEC && !extension_loaded('zstd'))
74 ) {
75 continue;
76 }
77 $data_file = $this->add_data_file(sprintf('data-wr-null-%s.avr', $codec));
78 $writers_schema = '"null"';
79 $data = null;
80 $dw = AvroDataIO::openFile($data_file, 'w', $writers_schema, $codec);
81 $dw->append($data);
82 $dw->close();
83
84 $dr = AvroDataIO::openFile($data_file);
85 $read_data = $dr->data();
86 $datum = reset($read_data);
87 $dr->close();
88 $this->assertEquals($data, $datum);
89 }
90 }
91
92 public function test_write_read_string_round_trip()
93 {

Callers

nothing calls this directly

Calls 7

add_data_fileMethod · 0.95
validCodecsMethod · 0.80
openFileMethod · 0.80
assertEqualsMethod · 0.80
closeMethod · 0.65
appendMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected