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

Method test_write_read_nothing_round_trip

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

Source from the content-addressed store, hash-verified

29 private $data_files;
30
31 public function test_write_read_nothing_round_trip()
32 {
33 foreach (AvroDataIO::validCodecs() as $codec) {
34 if (
35 ($codec === AvroDataIO::SNAPPY_CODEC && !extension_loaded('snappy'))
36 || ($codec === AvroDataIO::ZSTANDARD_CODEC && !extension_loaded('zstd'))
37 ) {
38 continue;
39 }
40 $data_file = $this->add_data_file(sprintf('data-wr-nothing-null-%s.avr', $codec));
41 $writers_schema = '"null"';
42 $dw = AvroDataIO::openFile($data_file, 'w', $writers_schema, $codec);
43 $dw->close();
44
45 $dr = AvroDataIO::openFile($data_file);
46 $data = $dr->data();
47 $dr->close();
48 $this->assertEmpty($data);
49 }
50 }
51
52 protected function add_data_file($data_file)
53 {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected