PHP  
 PHP_7_1
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/curl/tests/bug27023.phpt ('Bug #27023 (CURLOPT_POSTFIELDS does not parse content types for files)')

Script

1: <?php
2:
3:
include 'server.inc';
4:
$host curl_cli_server_start();
5:
$ch curl_init();
6:
curl_setopt($chCURLOPT_SAFE_UPLOAD1);
7:
curl_setopt($chCURLOPT_URL"{$host}/get.php?test=file");
8:
curl_setopt($chCURLOPT_RETURNTRANSFER1);
9:
10:
$file curl_file_create(__DIR__ '/curl_testdata1.txt');
11:
$params = array('file' => $file);
12:
curl_setopt($chCURLOPT_POSTFIELDS$params);
13:
var_dump(curl_exec($ch));
14:
15:
$file curl_file_create(__DIR__ '/curl_testdata1.txt'"text/plain");
16:
$params = array('file' => $file);
17:
curl_setopt($chCURLOPT_POSTFIELDS$params);
18:
var_dump(curl_exec($ch));
19:
20:
$file curl_file_create(__DIR__ '/curl_testdata1.txt'null"foo.txt");
21:
$params = array('file' => $file);
22:
curl_setopt($chCURLOPT_POSTFIELDS$params);
23:
var_dump(curl_exec($ch));
24:
25:
$file curl_file_create(__DIR__ '/curl_testdata1.txt'"text/plain""foo.txt");
26:
$params = array('file' => $file);
27:
curl_setopt($chCURLOPT_POSTFIELDS$params);
28:
var_dump(curl_exec($ch));
29:
30:
31:
curl_close($ch);
32:
?>
33:

Expected

string(%d) "curl_testdata1.txt|application/octet-stream"
string(%d) "curl_testdata1.txt|text/plain"
string(%d) "foo.txt|application/octet-stream"
string(%d) "foo.txt|text/plain"

Output

string(215) "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /responder/get.php was not found on this server.</p>
</body></html>
"
string(215) "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /responder/get.php was not found on this server.</p>
</body></html>
"
string(215) "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /responder/get.php was not found on this server.</p>
</body></html>
"
string(215) "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /responder/get.php was not found on this server.</p>
</body></html>
"

Diff

001+ string(215) "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
002+ <html><head>
003+ <title>404 Not Found</title>
004+ </head><body>
001- string(%d) "curl_testdata1.txt|application/octet-stream"
002- string(%d) "curl_testdata1.txt|text/plain"
003- string(%d) "foo.txt|application/octet-stream"
004- string(%d) "foo.txt|text/plain"
005+ <h1>Not Found</h1>
006+ <p>The requested URL /responder/get.php was not found on this server.</p>
007+ </body></html>
008+ "
009+ string(215) "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
010+ <html><head>
011+ <title>404 Not Found</title>
012+ </head><body>
013+ <h1>Not Found</h1>
014+ <p>The requested URL /responder/get.php was not found on this server.</p>
015+ </body></html>
016+ "
017+ string(215) "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
018+ <html><head>
019+ <title>404 Not Found</title>
020+ </head><body>
021+ <h1>Not Found</h1>
022+ <p>The requested URL /responder/get.php was not found on this server.</p>
023+ </body></html>
024+ "
025+ string(215) "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
026+ <html><head>
027+ <title>404 Not Found</title>
028+ </head><body>
029+ <h1>Not Found</h1>
030+ <p>The requested URL /responder/get.php was not found on this server.</p>
031+ </body></html>
032+ "

 

Generated at Fri, 15 Mar 2019 21:51:14 +0000 (7 days ago)

Copyright © 2005-2019 The PHP Group
All rights reserved.