session_module_name_variation4.phpt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --TEST--
  2. Test session_module_name() function : variation
  3. --SKIPIF--
  4. <?php include('skipif.inc'); ?>
  5. --INI--
  6. session.gc_probability=1
  7. session.gc_divisor=1
  8. session.gc_maxlifetime=0
  9. --FILE--
  10. <?php
  11. ob_start();
  12. /*
  13. * Prototype : string session_module_name([string $module])
  14. * Description : Get and/or set the current session module
  15. * Source code : ext/session/session.c
  16. */
  17. echo "*** Testing session_module_name() : variation ***\n";
  18. require_once "save_handler.inc";
  19. $path = dirname(__FILE__);
  20. session_save_path($path);
  21. session_module_name("files");
  22. session_start();
  23. $_SESSION["Blah"] = "Hello World!";
  24. $_SESSION["Foo"] = FALSE;
  25. $_SESSION["Guff"] = 1234567890;
  26. var_dump($_SESSION);
  27. var_dump(session_write_close());
  28. session_start();
  29. var_dump($_SESSION);
  30. var_dump(session_destroy());
  31. session_start();
  32. var_dump($_SESSION);
  33. var_dump(session_destroy());
  34. ob_end_flush();
  35. ?>
  36. --EXPECTF--
  37. *** Testing session_module_name() : variation ***
  38. array(3) {
  39. ["Blah"]=>
  40. string(12) "Hello World!"
  41. ["Foo"]=>
  42. bool(false)
  43. ["Guff"]=>
  44. int(1234567890)
  45. }
  46. NULL
  47. array(3) {
  48. ["Blah"]=>
  49. string(12) "Hello World!"
  50. ["Foo"]=>
  51. bool(false)
  52. ["Guff"]=>
  53. int(1234567890)
  54. }
  55. bool(true)
  56. array(0) {
  57. }
  58. bool(true)