Skip to content

Commit 5f63fd8

Browse files
committed
Add test for copy from empty file
1 parent c37bd23 commit 5f63fd8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
stream_copy_to_stream() from empty file
3+
--FILE--
4+
<?php
5+
6+
$tmp_empty_file = __FILE__ . ".tmp";
7+
file_put_contents($tmp_empty_file, "");
8+
9+
$in = fopen($tmp_empty_file, 'r');
10+
$out = fopen('php://memory', 'w');
11+
var_dump(stream_copy_to_stream($in, $out));
12+
13+
?>
14+
--CLEAN--
15+
<?php
16+
unlink(__FILE__ . ".tmp");
17+
?>
18+
--EXPECT--
19+
int(0)

0 commit comments

Comments
 (0)