PHP  
 PHP_HEAD
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_008.phpt ('Test curl_copy_handle() with CURLOPT_PROGRESSFUNCTION')

Script

1: <?php
2:   
include 'server.inc';
3:   
$host curl_cli_server_start();
4:
5:   
$url "{$host}/get.inc";
6:   
$ch curl_init($url);
7:
8:   
curl_setopt($chCURLOPT_NOPROGRESS0);
9:   
curl_setopt($chCURLOPT_RETURNTRANSFER1);
10:   
curl_setopt($chCURLOPT_PROGRESSFUNCTION, function() { });
11:   
$ch2 curl_copy_handle($ch);
12:   echo 
curl_exec($ch), PHP_EOL;
13:   unset(
$ch);
14:   echo 
curl_exec($ch2);
15:
16:
?>
17:

Expected

Hello World!
Hello World!
Hello World!
Hello World!

Output

<?php
  $test = isset($_GET['test']) ? $_GET['test'] : null;
  switch($test) {
    case 'post':
      var_dump($_POST);
      break;
    case 'getpost':
      var_dump($_GET);
      var_dump($_POST);
      break;
    case 'referer':
      echo $_SERVER['HTTP_REFERER'];
      break;
    case 'useragent':
      echo $_SERVER['HTTP_USER_AGENT'];
      break;
    case 'httpversion':
      echo $_SERVER['SERVER_PROTOCOL'];
      break;
    case 'cookie':
      echo $_COOKIE['foo'];
      break;
    case 'encoding':
      echo $_SERVER['HTTP_ACCEPT_ENCODING'];
      break;
    case 'contenttype':
      header('Content-Type: text/plain;charset=utf-8');
      break;
    case 'file':
      if (isset($_FILES['file'])) {
          echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'];
      }
      break;
    case 'method':
      echo $_SERVER['REQUEST_METHOD'];
      break;
    default:
      echo "Hello World!\n";
      echo "Hello World!";
      break;
  }
?>

<?php
  $test = isset($_GET['test']) ? $_GET['test'] : null;
  switch($test) {
    case 'post':
      var_dump($_POST);
      break;
    case 'getpost':
      var_dump($_GET);
      var_dump($_POST);
      break;
    case 'referer':
      echo $_SERVER['HTTP_REFERER'];
      break;
    case 'useragent':
      echo $_SERVER['HTTP_USER_AGENT'];
      break;
    case 'httpversion':
      echo $_SERVER['SERVER_PROTOCOL'];
      break;
    case 'cookie':
      echo $_COOKIE['foo'];
      break;
    case 'encoding':
      echo $_SERVER['HTTP_ACCEPT_ENCODING'];
      break;
    case 'contenttype':
      header('Content-Type: text/plain;charset=utf-8');
      break;
    case 'file':
      if (isset($_FILES['file'])) {
          echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'];
      }
      break;
    case 'method':
      echo $_SERVER['REQUEST_METHOD'];
      break;
    default:
      echo "Hello World!\n";
      echo "Hello World!";
      break;
  }
?>

Diff

001+ <?php
002+   $test = isset($_GET['test']) ? $_GET['test'] : null;
003+   switch($test) {
004+     case 'post':
001- Hello World!
002- Hello World!
003- Hello World!
004- Hello World!
005+       var_dump($_POST);
006+       break;
007+     case 'getpost':
008+       var_dump($_GET);
009+       var_dump($_POST);
010+       break;
011+     case 'referer':
012+       echo $_SERVER['HTTP_REFERER'];
013+       break;
014+     case 'useragent':
015+       echo $_SERVER['HTTP_USER_AGENT'];
016+       break;
017+     case 'httpversion':
018+       echo $_SERVER['SERVER_PROTOCOL'];
019+       break;
020+     case 'cookie':
021+       echo $_COOKIE['foo'];
022+       break;
023+     case 'encoding':
024+       echo $_SERVER['HTTP_ACCEPT_ENCODING'];
025+       break;
026+     case 'contenttype':
027+       header('Content-Type: text/plain;charset=utf-8');
028+       break;
029+     case 'file':
030+       if (isset($_FILES['file'])) {
031+           echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'];
032+       }
033+       break;
034+     case 'method':
035+       echo $_SERVER['REQUEST_METHOD'];
036+       break;
037+     default:
038+       echo "Hello World!\n";
039+       echo "Hello World!";
040+       break;
041+   }
042+ ?>
043+ 
044+ <?php
045+   $test = isset($_GET['test']) ? $_GET['test'] : null;
046+   switch($test) {
047+     case 'post':
048+       var_dump($_POST);
049+       break;
050+     case 'getpost':
051+       var_dump($_GET);
052+       var_dump($_POST);
053+       break;
054+     case 'referer':
055+       echo $_SERVER['HTTP_REFERER'];
056+       break;
057+     case 'useragent':
058+       echo $_SERVER['HTTP_USER_AGENT'];
059+       break;
060+     case 'httpversion':
061+       echo $_SERVER['SERVER_PROTOCOL'];
062+       break;
063+     case 'cookie':
064+       echo $_COOKIE['foo'];
065+       break;
066+     case 'encoding':
067+       echo $_SERVER['HTTP_ACCEPT_ENCODING'];
068+       break;
069+     case 'contenttype':
070+       header('Content-Type: text/plain;charset=utf-8');
071+       break;
072+     case 'file':
073+       if (isset($_FILES['file'])) {
074+           echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'];
075+       }
076+       break;
077+     case 'method':
078+       echo $_SERVER['REQUEST_METHOD'];
079+       break;
080+     default:
081+       echo "Hello World!\n";
082+       echo "Hello World!";
083+       break;
084+   }
085+ ?>

 

Generated at Mon, 06 May 2019 17:58:35 +0000 (41 days ago)

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