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/curl_copy_handle_basic_006.phpt ('Test curl_copy_handle() with User Agent')

Script

1: <?php
2:
3:   
include 'server.inc';
4:   
$host curl_cli_server_start();
5:
6:   echo 
'*** Testing curl copy handle with User Agent ***' "\n";
7:
8:   
$url "{$host}/get.php?test=useragent";
9:   
$ch curl_init();
10:
11:   
ob_start(); // start output buffering
12:   
curl_setopt($chCURLOPT_RETURNTRANSFER1);
13:   
curl_setopt($chCURLOPT_USERAGENT'cURL phpt');
14:   
curl_setopt($chCURLOPT_URL$url); //set the url we want to use
15:
16:   
$copy curl_copy_handle($ch);
17:
18:   
var_dumpcurl_exec($ch) );
19:   
var_dumpcurl_exec($copy) );
20:
21:   
curl_close($ch); // can not close original handle before curl_exec($copy) since it causes char * inputs to be invalid (see also: http://curl.haxx.se/libcurl/c/curl_easy_duphandle.html)
22:   
curl_close($copy);
23:
24:
?>
25:
===DONE===
26:

Expected

*** Testing curl copy handle with User Agent ***
string(9) "cURL phpt"
string(9) "cURL phpt"
===DONE===

Output

*** Testing curl copy handle with User Agent ***
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>
"
===DONE===

Diff

002+ string(215) "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
003+ <html><head>
004+ <title>404 Not Found</title>
002- string(9) "cURL phpt"
003- string(9) "cURL phpt"
004- ===DONE===
005+ </head><body>
006+ <h1>Not Found</h1>
007+ <p>The requested URL /responder/get.php was not found on this server.</p>
008+ </body></html>
009+ "
010+ string(215) "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
011+ <html><head>
012+ <title>404 Not Found</title>
013+ </head><body>
014+ <h1>Not Found</h1>
015+ <p>The requested URL /responder/get.php was not found on this server.</p>
016+ </body></html>
017+ "
018+ ===DONE===

 

Generated at Fri, 11 Jan 2019 15:03:22 +0000 (7 days ago)

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