Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public function testAllWritersCanWriteToStream(string $format): void |
||
31 | { |
||
32 | $spreadsheet = new Spreadsheet(); |
||
33 | $spreadsheet->getActiveSheet()->setCellValue('A1', 'foo'); |
||
34 | $writer = IOFactory::createWriter($spreadsheet, $format); |
||
35 | |||
36 | $stream = fopen('php://memory', 'wb+'); |
||
37 | self::assertSame(0, fstat($stream)['size']); |
||
1 ignored issue
–
show
|
|||
38 | |||
39 | $writer->save($stream); |
||
1 ignored issue
–
show
|
|||
40 | |||
41 | self::assertIsResource($stream, 'should not close the stream for further usage out of PhpSpreadsheet'); |
||
42 | self::assertGreaterThan(0, fstat($stream)['size'], 'something should have been written to the stream'); |
||
43 | self::assertGreaterThan(0, ftell($stream), 'should not be rewinded, because not all streams support it'); |
||
1 ignored issue
–
show
|
|||
44 | } |
||
46 |