PHP  
 PHP_7_3
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_017.phpt ('Test curl_multi_exec() function with basic functionality')

Script

1: <?php
2:
/* Prototype  : bool curl_multi_exec(resource ch)
3:  * Description: Perform a cURL session
4:  * Source code: ext/curl/multi.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:   
curl_setopt($chs[0], CURLOPT_URL$url); //set the url we want to use
24:   
curl_setopt($chs[1], CURLOPT_URL$url); //set the url we want to use
25:   
curl_setopt($chs[2], CURLOPT_URL$url); //set the url we want to use
26:
27:   
$mh curl_multi_init();
28:
29:   
// add handlers
30:   
curl_multi_add_handle($mh$chs[0]);
31:   
curl_multi_add_handle($mh$chs[1]);
32:   
curl_multi_add_handle($mh$chs[2]);
33:
34:   
$running=null;
35:   
//execute the handles
36:   
$state null;
37:   do {
38:     
$state curl_multi_exec($mh$running);
39:   } while (
$running 0);
40:
41:   
//close the handles
42:   
curl_multi_remove_handle($mh$chs[0]);
43:   
curl_multi_remove_handle($mh$chs[1]);
44:   
curl_multi_remove_handle($mh$chs[2]);
45:   
curl_multi_close($mh);
46:
47:   
$curl_content ob_get_contents();
48:   
ob_end_clean();
49:
50:   if(
$state === CURLM_OK) {
51:     
var_dump$curl_content );
52:   } else {
53:     echo 
"curl_exec returned false";
54:   }
55:
?>
56:
===DONE===
57:

Expected

*** Testing curl_exec() : basic functionality ***
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- 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 Thu, 14 Nov 2019 02:24:20 +0000 (11 hours ago)

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