summaryrefslogtreecommitdiff
path: root/sapi/cli/tests
diff options
context:
space:
mode:
authorAndrea Faulds <ajf@ajf.me>2013-10-17 22:19:09 +0000
committerAndrea Faulds <ajf@ajf.me>2013-11-12 20:27:34 +0000
commitaee271ec0d30c332bed32b5eca1fdff1cb447eab (patch)
tree13a9b01ee9246d7d95bb138fd599420ff74db35b /sapi/cli/tests
parent1984919ddc3252c0f9b5d5d0beef10bdc4804091 (diff)
downloadphp-git-aee271ec0d30c332bed32b5eca1fdff1cb447eab.tar.gz
Implemented FR #65917 (getallheaders() is not supported by the built-in...)
- Implemented apache_request_headers() and getallheaders() alias in CLI server - Implemented apache_response_headers() in CLI server using FastCGI code Conflicts: NEWS UPGRADING
Diffstat (limited to 'sapi/cli/tests')
-rw-r--r--sapi/cli/tests/php_cli_server_019.phpt46
1 files changed, 46 insertions, 0 deletions
diff --git a/sapi/cli/tests/php_cli_server_019.phpt b/sapi/cli/tests/php_cli_server_019.phpt
new file mode 100644
index 0000000000..8001f51941
--- /dev/null
+++ b/sapi/cli/tests/php_cli_server_019.phpt
@@ -0,0 +1,46 @@
+--TEST--
+Implement Req #65917 (getallheaders() is not supported by the built-in web server)
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+include "php_cli_server.inc";
+php_cli_server_start(<<<'PHP'
+header('Content-Type: text/plain');
+var_dump(getallheaders());
+var_dump(apache_request_headers());
+var_dump(apache_response_headers());
+PHP
+);
+
+$opts = array(
+ 'http'=>array(
+ 'method'=>"GET",
+ 'header'=>"Foo-Bar: bar\r\n"
+ )
+);
+
+$context = stream_context_create($opts);
+echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS, false, $context);
+?>
+--EXPECTF--
+array(2) {
+ ["Host"]=>
+ string(%s) "%s:%s"
+ ["Foo-Bar"]=>
+ string(3) "bar"
+}
+array(2) {
+ ["Host"]=>
+ string(%s) "%s:%s"
+ ["Foo-Bar"]=>
+ string(3) "bar"
+}
+array(2) {
+ ["X-Powered-By"]=>
+ string(%s) "PHP/%s"
+ ["Content-Type"]=>
+ string(10) "text/plain"
+}