ext-uv/tests/300-fs_close.phpt

20 lines
550 B
Plaintext
Raw Normal View History

--TEST--
Check for fs read and close
--FILE--
<?php
define("FIXTURE_PATH", dirname(__FILE__) . "/fixtures/hello.data");
2015-01-18 17:24:13 +01:00
uv_fs_open(uv_default_loop(), FIXTURE_PATH, UV::O_RDONLY, 0, function($r){
uv_fs_read(uv_default_loop(), $r, 0, 32, function($stream, $nread, $data) {
uv_fs_close(uv_default_loop(), 42, function($result) {
if($result != 42) {
echo "OK";
}
});
});
});
uv_run();
--EXPECTF--
2015-01-18 17:24:13 +01:00
Warning: uv_fs_close() expects parameter 2 to be resource, integer given in %s on line %d