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

Method test_write_read_string_round_trip

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

Source from the content-addressed store, hash-verified

90 }
91
92 public function test_write_read_string_round_trip()
93 {
94 foreach (AvroDataIO::validCodecs() as $codec) {
95 if (
96 ($codec === AvroDataIO::SNAPPY_CODEC && !extension_loaded('snappy'))
97 || ($codec === AvroDataIO::ZSTANDARD_CODEC && !extension_loaded('zstd'))
98 ) {
99 continue;
100 }
101 $data_file = $this->add_data_file(sprintf('data-wr-str-%s.avr', $codec));
102 $writers_schema = '"string"';
103 $data = 'foo';
104 $dw = AvroDataIO::openFile($data_file, 'w', $writers_schema, $codec);
105 $dw->append($data);
106 $dw->close();
107
108 $dr = AvroDataIO::openFile($data_file);
109 $read_data = $dr->data();
110 $datum = array_shift($read_data);
111 $dr->close();
112 $this->assertEquals($data, $datum);
113 }
114 }
115
116 public function test_write_read_round_trip()
117 {

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