Skip to content

Commit f1bdcca

Browse files
committed
Add test about attempting to cast an uncastable userstream
1 parent 21e5dfc commit f1bdcca

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
Non castable user-space streams (stream_cast())
3+
--FILE--
4+
<?php
5+
class test_wrapper {
6+
public $context;
7+
public $return_value;
8+
function stream_open($path, $mode, $openedpath) {
9+
return true;
10+
}
11+
function stream_eof() {
12+
return false;
13+
}
14+
}
15+
16+
stream_wrapper_register('test', 'test_wrapper');
17+
$fd = fopen("test://foo","r");
18+
var_dump(stream_isatty($fd));
19+
20+
?>
21+
--EXPECTF--
22+
Warning: stream_isatty(): test_wrapper::stream_cast is not implemented! in %s on line %d
23+
24+
Warning: stream_isatty(): test_wrapper::stream_cast is not implemented! in %s on line %d
25+
bool(false)

0 commit comments

Comments
 (0)