Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function testRead() : void |
||
28 | { |
||
29 | $stream = fopen('php://memory', 'r+'); |
||
30 | fwrite($stream, '1234'); |
||
31 | rewind($stream); |
||
32 | |||
33 | $inputStream = new ResourceInputStream($stream); |
||
34 | |||
35 | $input = ''; |
||
36 | $inputStream->read(4, function ($buffer) use (&$input) { |
||
37 | $input .= $buffer; |
||
38 | }); |
||
39 | |||
40 | static::assertSame('1234', $input); |
||
41 | |||
42 | fclose($stream); |
||
43 | } |
||
45 |