apache_response_headers.phpt 879 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. apache_response_headers()
  3. --SKIPIF--
  4. <?php
  5. include "skipif.inc";
  6. ?>
  7. --FILE--
  8. <?php
  9. include "include.inc";
  10. $php = get_cgi_path();
  11. reset_env_vars();
  12. $test_file = __DIR__ . DIRECTORY_SEPARATOR ."apache_response_headers.test.php";
  13. $code = '<?php';
  14. $code .= '
  15. header( "X-Robots-Tag : noindex,nofollow,noarchive" );
  16. header( "Content-type: text/html; charset=UTF-8" );
  17. header( "Bad-header" );
  18. header( " : " );
  19. header( ":" );
  20. flush();
  21. var_dump( apache_response_headers() );
  22. ?>
  23. ';
  24. file_put_contents( $test_file, $code );
  25. passthru( "$php -n -q " . escapeshellarg( $test_file ) );
  26. ?>
  27. --CLEAN--
  28. <?php
  29. @unlink( __DIR__ . DIRECTORY_SEPARATOR ."apache_response_headers.test.php" );
  30. ?>
  31. --EXPECTF--
  32. array(3) {
  33. ["X-Powered-By"]=>
  34. string(%d) "PHP/%s"
  35. ["X-Robots-Tag"]=>
  36. string(26) "noindex,nofollow,noarchive"
  37. ["Content-type"]=>
  38. string(24) "text/html; charset=UTF-8"
  39. }