bug61679.phpt 665 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. Bug #61679 (Error on non-standard HTTP methods)
  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. echo "This should never echo";
  12. PHP
  13. );
  14. $host = PHP_CLI_SERVER_HOSTNAME;
  15. $fp = php_cli_server_connect();
  16. // Send a request with a fictitious request method,
  17. // I like smurfs, the smurf everything.
  18. if(fwrite($fp, <<<HEADER
  19. SMURF / HTTP/1.1
  20. Host: {$host}
  21. HEADER
  22. )) {
  23. while (!feof($fp)) {
  24. echo fgets($fp);
  25. // Only echo the first line from the response,
  26. // the rest is not interesting
  27. break;
  28. }
  29. }
  30. fclose($fp);
  31. ?>
  32. --EXPECT--
  33. HTTP/1.1 501 Not Implemented