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_basic_018.phpt ('Test curl_setopt() with curl_multi function with basic functionality')

Script

1: <?php
2:
/* Prototype  : bool curl_setopt(resource ch, int option, mixed value)
3:  * Description: Set an option for a cURL transfer
4:  * Source code: ext/curl/interface.c
5:  * Alias to functions:
6:  */
7:
8:   
include 'server.inc';
9:   
$host curl_cli_server_start();
10:
11:   
// start testing
12:   
echo "*** Testing curl_exec() : basic functionality ***\n";
13:
14:   
$url "{$host}/get.php?test=get";
15:   
$chs = array(
16:     
=> curl_init(),
17:     
=> curl_init(),
18:     
=> curl_init(),
19:   );
20:
21:   
ob_start(); // start output buffering
22:
23:   
$options = array(
24:     
CURLOPT_RETURNTRANSFER => 1,
25:     
CURLOPT_URL => $url,
26:   );
27:
28:   
curl_setopt_array($chs[0], $options); //set the options
29:   
curl_setopt_array($chs[1], $options); //set the options
30:   
curl_setopt_array($chs[2], $options); //set the options
31:
32:   
$mh curl_multi_init();
33:
34:   
// add handlers
35:   
curl_multi_add_handle($mh$chs[0]);
36:   
curl_multi_add_handle($mh$chs[1]);
37:   
curl_multi_add_handle($mh$chs[2]);
38:
39:   
$running=null;
40:   
//execute the handles
41:   
do {
42:     
curl_multi_exec($mh$running);
43:   } while (
$running 0);
44:
45:   
$curl_content '';
46:   
$curl_content .= curl_multi_getcontent($chs[0]);
47:   
$curl_content .= curl_multi_getcontent($chs[1]);
48:   
$curl_content .= curl_multi_getcontent($chs[2]);
49:
50:   
//close the handles
51:   
curl_multi_remove_handle($mh$chs[0]);
52:   
curl_multi_remove_handle($mh$chs[1]);
53:   
curl_multi_remove_handle($mh$chs[2]);
54:   
curl_multi_close($mh);
55:
56:   
var_dump$curl_content );
57:
58:
?>
59:
===DONE===
60:

Expected

*** Testing curl_exec() : basic functionality ***
%unicode|string%(75) "Hello World!
Hello World!Hello World!
Hello World!Hello World!
Hello World!"
===DONE===

Output

*** Testing curl_exec() : basic functionality ***
string(645) "<!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>
<!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>
<!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(645) "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
003+ <html><head>
004+ <title>404 Not Found</title>
005+ </head><body>
006+ <h1>Not Found</h1>
002- %unicode|string%(75) "Hello World!
003- Hello World!Hello World!
004- Hello World!Hello World!
005- Hello World!"
006- ===DONE===
007+ <p>The requested URL /responder/get.php was not found on this server.</p>
008+ </body></html>
009+ <!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+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
017+ <html><head>
018+ <title>404 Not Found</title>
019+ </head><body>
020+ <h1>Not Found</h1>
021+ <p>The requested URL /responder/get.php was not found on this server.</p>
022+ </body></html>
023+ "
024+ ===DONE===

 

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

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