xref: /PHP-5.5/ext/curl/tests/bug64267.phpt (revision b79301d1)
1--TEST--
2Bug #64267 (CURLOPT_INFILE doesn't allow reset)
3--SKIPIF--
4<?php
5extension_loaded("curl") or die("skip need ext/curl");
6?>
7--FILE--
8<?php
9
10echo "TEST\n";
11
12$c = curl_init("http://google.com");
13$f = fopen(__FILE__,"r");
14var_dump(curl_setopt_array($c, [
15	CURLOPT_RETURNTRANSFER => true,
16	CURLOPT_UPLOAD => true,
17	CURLOPT_INFILE => $f,
18	CURLOPT_INFILESIZE => filesize(__FILE__)
19]));
20fclose($f);
21var_dump(curl_setopt_array($c, [
22	CURLOPT_UPLOAD => false,
23	CURLOPT_INFILE => null,
24	CURLOPT_INFILESIZE => 0,
25]));
26curl_exec($c);
27var_dump(curl_getinfo($c, CURLINFO_RESPONSE_CODE));
28?>
29===DONE===
30--EXPECTF--
31TEST
32bool(true)
33bool(true)
34int(30%d)
35===DONE===
36