--TEST-- swoole_http_client: download file --SKIPIF-- --FILE-- parentFunc = function ($pid) { $cli = new swoole_http_client('127.0.0.1', 9501); $cli->on('close', function ($cli) { echo "close\n"; }); $cli->on('error', function ($cli) { echo "error\n"; }); $cli->download('/get_file', __DIR__.'/tmpfile', function ($cli) { assert($cli->statusCode == 200); assert(md5_file($cli->downloadFile) == md5_file(TEST_IMAGE)); $cli->close(); unlink(__DIR__ . '/tmpfile'); }); swoole_event::wait(); swoole_process::kill($pid); }; $pm->childFunc = function () use ($pm) { include __DIR__ . "/../include/api/http_server.php"; }; $pm->childFirst(); $pm->run(); ?> --EXPECT-- close