1--TEST--
2Test curl_copy_handle() after exec()
3--CREDITS--
4Rick Buitenman <rick@meritos.nl>
5#testfest Utrecht 2009
6--SKIPIF--
7<?php include 'skipif.inc'; ?>
8--FILE--
9<?php
10
11  include 'server.inc';
12  $host = curl_cli_server_start();
13
14  echo '*** Test curl_copy_handle() after exec() ***' . "\n";
15
16  $url = "{$host}/get.php?test=getpost&get_param=Hello%20World";
17  $ch = curl_init();
18
19  ob_start(); // start output buffering
20  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
21  curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
22
23
24  $curl_content = curl_exec($ch);
25  $copy = curl_copy_handle($ch);
26  curl_close($ch);
27
28  $curl_content_copy = curl_exec($copy);
29  curl_close($copy);
30
31  var_dump( $curl_content_copy );
32?>
33===DONE===
34--EXPECT--
35*** Test curl_copy_handle() after exec() ***
36string(106) "array(2) {
37  ["test"]=>
38  string(7) "getpost"
39  ["get_param"]=>
40  string(11) "Hello World"
41}
42array(0) {
43}
44"
45===DONE===
46