Annotation of embedaddon/php/ext/standard/tests/http/bug53198.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #53198 (From: header cannot be changed with ini_set)
3: --SKIPIF--
4: <?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?>
5: --INI--
6: allow_url_fopen=1
7: from=teste@teste.pt
8: --FILE--
9: <?php
10: require 'server.inc';
11:
12: function do_test() {
13:
14: $responses = array(
15: "data://text/plain,HTTP/1.0 200 OK\r\n\r\n",
16: );
17:
18: $pid = http_server("tcp://127.0.0.1:12342", $responses, $output);
19:
20: foreach($responses as $r) {
21:
22: $fd = fopen('http://127.0.0.1:12342/', 'rb', false);
23:
24: fseek($output, 0, SEEK_SET);
25: var_dump(stream_get_contents($output));
26: fseek($output, 0, SEEK_SET);
27: }
28:
29: http_server_kill($pid);
30:
31: }
32:
33: echo "-- Test: leave default --\n";
34:
35: do_test();
36:
37: echo "-- Test: after ini_set --\n";
38:
39: ini_set('from', 'junk@junk.com');
40:
41: do_test();
42:
43: ?>
44: --EXPECT--
45: -- Test: leave default --
46: string(63) "GET / HTTP/1.0
47: From: teste@teste.pt
48: Host: 127.0.0.1:12342
49:
50: "
51: -- Test: after ini_set --
52: string(62) "GET / HTTP/1.0
53: From: junk@junk.com
54: Host: 127.0.0.1:12342
55:
56: "
57:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>