bug65066_422.phpt 607 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Bug #65066 (Cli server not responsive when responding with 422 http status code): 422 status code
  3. --INI--
  4. allow_url_fopen=1
  5. --SKIPIF--
  6. <?php
  7. include "skipif.inc";
  8. ?>
  9. --FILE--
  10. <?php
  11. include "php_cli_server.inc";
  12. php_cli_server_start('http_response_code(422);');
  13. $host = PHP_CLI_SERVER_HOSTNAME;
  14. $fp = php_cli_server_connect();
  15. if(fwrite($fp, <<<HEADER
  16. GET / HTTP/1.1
  17. Host: {$host}
  18. HEADER
  19. )) {
  20. while (!feof($fp)) {
  21. echo fgets($fp);
  22. }
  23. }
  24. ?>
  25. --EXPECTF--
  26. HTTP/1.1 422 Unknown Status Code
  27. Host: %s
  28. Date: %s
  29. Connection: close
  30. X-Powered-By: PHP/%s
  31. Content-type: text/html; charset=UTF-8