session_module_name_variation4.phpt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. $oldsession = $_SESSION;
  28. var_dump(session_write_close());
  29. session_start();
  30. // the session may have been GC'd or not; we accept either outcome
  31. var_dump($_SESSION === $oldsession || $_SESSION === []);
  32. var_dump(session_destroy());
  33. session_start();
  34. var_dump($_SESSION);
  35. var_dump(session_destroy());
  36. ob_end_flush();
  37. ?>
  38. --EXPECT--
  39. *** Testing session_module_name() : variation ***
  40. array(3) {
  41. ["Blah"]=>
  42. string(12) "Hello World!"
  43. ["Foo"]=>
  44. bool(false)
  45. ["Guff"]=>
  46. int(1234567890)
  47. }
  48. bool(true)
  49. bool(true)
  50. bool(true)
  51. array(0) {
  52. }
  53. bool(true)