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_001.phpt ('Test curl_exec() function with basic functionality')

Script

1: <?php
2:
/* Prototype  : bool curl_exec(resource ch)
3:  * Description: Perform a cURL session
4:  * Source code: ext/curl/interface.c
5:  * Alias to functions:
6:  */
7:   
include 'server.inc';
8:   
$host curl_cli_server_start();
9:
10:   
// start testing
11:   
echo "*** Testing curl_exec() : basic functionality ***\n";
12:
13:   
$url "{$host}/get.php?test=get";
14:   
$ch curl_init();
15:
16:   
ob_start(); // start output buffering
17:   
curl_setopt($chCURLOPT_URL$url); //set the url we want to use
18:   
$ok curl_exec($ch);
19:   
curl_close($ch);
20:   
$curl_content ob_get_contents();
21:   
ob_end_clean();
22:
23:   if(
$ok) {
24:     
var_dump$curl_content );
25:   } else {
26:     echo 
"curl_exec returned false";
27:   }
28:
?>
29:
===DONE===
30:

Expected

*** Testing curl_exec() : basic functionality ***
string(25) "Hello World!
Hello World!"
===DONE===

Output

*** Testing curl_exec() : basic functionality ***
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>
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+ "
002- string(25) "Hello World!
003- Hello World!"

 

Generated at Sun, 23 Jun 2019 06:34:16 +0000 (3 days ago)

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