PHP  
 PHP_5_4
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/standard/tests/http/bug53198.phpt ('Bug #53198 (From: header cannot be changed with ini_set)')

Script

1: <?php
2:
require 'server.inc';
3:
4: function 
do_test() {
5:
6:     
$responses = array(
7:         
"data://text/plain,HTTP/1.0 200 OK\r\n\r\n",
8:     );
9:
10:     
$pid http_server("tcp://127.0.0.1:12342"$responses$output);
11:
12:     foreach(
$responses as $r) {
13:
14:         
$fd fopen('http://127.0.0.1:12342/''rb'false);
15:
16:         
fseek($output0SEEK_SET);
17:         
var_dump(stream_get_contents($output));
18:         
fseek($output0SEEK_SET);
19:     }
20:
21:     
http_server_kill($pid);
22:
23: }
24:
25: echo 
"-- Test: leave default --\n";
26:
27:
do_test();
28:
29: echo 
"-- Test: after ini_set --\n";
30:
31:
ini_set('from''junk@junk.com');
32:
33:
do_test();
34:
35:
?>
36:

Expected

-- Test: leave default --
string(63) "GET / HTTP/1.0
From: teste@teste.pt
Host: 127.0.0.1:12342

"
-- Test: after ini_set --
string(62) "GET / HTTP/1.0
From: junk@junk.com
Host: 127.0.0.1:12342

"

Output

-- Test: leave default --
string(0) ""
-- Test: after ini_set --
string(0) ""

Diff

002+ string(0) ""
002- string(63) "GET / HTTP/1.0
003- From: teste@teste.pt
004- Host: 127.0.0.1:12342
005- 
006- "
004+ string(0) ""
008- string(62) "GET / HTTP/1.0
009- From: junk@junk.com
010- Host: 127.0.0.1:12342
011- 
012- "

 

Generated at Sun, 17 Aug 2014 15:22:07 +0000 (4 days ago)

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