bug67429_2.phpt 541 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. FR #67429 (CLI server is missing some new HTTP response codes)
  3. --SKIPIF--
  4. <?php
  5. include "skipif.inc";
  6. ?>
  7. --FILE--
  8. <?php
  9. include "php_cli_server.inc";
  10. php_cli_server_start(<<<PHP
  11. http_response_code(426);
  12. PHP
  13. );
  14. $host = PHP_CLI_SERVER_HOSTNAME;
  15. $fp = php_cli_server_connect();
  16. if(fwrite($fp, <<<HEADER
  17. GET / HTTP/1.1
  18. HEADER
  19. )) {
  20. while (!feof($fp)) {
  21. echo fgets($fp);
  22. }
  23. }
  24. fclose($fp);
  25. ?>
  26. --EXPECTF--
  27. HTTP/1.1 426 Upgrade Required
  28. Date: %s
  29. Connection: close
  30. X-Powered-By: %s
  31. Content-type: text/html; charset=UTF-8