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_007.phpt ('Test curl_copy_handle() with simple POST')

Script

1: <?php
2:   
include 'server.inc';
3:   
$host curl_cli_server_start();
4:
5:   echo 
'*** Testing curl copy handle with simple POST using array as arguments ***' "\n";
6:
7:   
$url "{$host}/get.php?test=getpost";
8:   
$ch curl_init();
9:
10:   
ob_start(); // start output buffering
11:   
curl_setopt($chCURLOPT_RETURNTRANSFER1);
12:   
curl_setopt($chCURLOPT_POST1);
13:   
curl_setopt($chCURLOPT_POSTFIELDS, array("Hello" => "World""Foo" => "Bar""Person" => "John Doe"));
14:   
curl_setopt($chCURLOPT_HTTPHEADER, array('Expect:')); // Disable Expect: header (lighttpd does not support it :)
15:   
curl_setopt($chCURLOPT_URL$url); //set the url we want to use
16:
17:   
$copy curl_copy_handle($ch);
18:   
curl_close($ch);
19:
20:   
$curl_content curl_exec($copy);
21:   
curl_close($copy);
22:
23:   
var_dump$curl_content );
24:
?>
25:
===DONE===
26:

Expected

*** Testing curl copy handle with simple POST using array as arguments ***
string(163) "array(1) {
  ["test"]=>
  string(7) "getpost"
}
array(3) {
  ["Hello"]=>
  string(5) "World"
  ["Foo"]=>
  string(3) "Bar"
  ["Person"]=>
  string(8) "John Doe"
}
"
===DONE===

Output

*** Testing curl copy handle with simple POST using array as arguments ***
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>
002- string(163) "array(1) {
003-   ["test"]=>
004-   string(7) "getpost"
005- }
006- array(3) {
007-   ["Hello"]=>
008-   string(5) "World"
009-   ["Foo"]=>
010-   string(3) "Bar"
011-   ["Person"]=>
012-   string(8) "John Doe"
013- }

 

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

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