session_basic1.phpt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. --TEST--
  2. Test basic function : variation1
  3. --INI--
  4. session.use_strict_mode=0
  5. session.save_handler=files
  6. session.gc_probability=1
  7. session.gc_divisor=1000
  8. session.gc_maxlifetime=300
  9. session.save_path=
  10. session.name=PHPSESSID
  11. --EXTENSIONS--
  12. session
  13. --SKIPIF--
  14. <?php include('skipif.inc'); ?>
  15. --FILE--
  16. <?php
  17. ob_start();
  18. echo "*** Testing basic session functionality : variation1 ***\n";
  19. $session_id = 'session-basic1';
  20. session_id($session_id);
  21. $path = __DIR__;
  22. var_dump(session_save_path($path));
  23. echo "*** Without lazy_write ***\n";
  24. var_dump(session_id($session_id));
  25. $config = ['lazy_write'=>FALSE];
  26. var_dump(session_start($config));
  27. var_dump($config);
  28. var_dump(session_write_close());
  29. var_dump(session_id());
  30. echo "*** With lazy_write ***\n";
  31. var_dump(session_id($session_id));
  32. var_dump(session_start(['lazy_write'=>TRUE]));
  33. var_dump(session_commit());
  34. var_dump(session_id());
  35. echo "*** Cleanup ***\n";
  36. var_dump(session_id($session_id));
  37. var_dump(session_start());
  38. var_dump(session_destroy());
  39. ob_end_flush();
  40. ?>
  41. --EXPECT--
  42. *** Testing basic session functionality : variation1 ***
  43. string(0) ""
  44. *** Without lazy_write ***
  45. string(14) "session-basic1"
  46. bool(true)
  47. array(1) {
  48. ["lazy_write"]=>
  49. bool(false)
  50. }
  51. bool(true)
  52. string(14) "session-basic1"
  53. *** With lazy_write ***
  54. string(14) "session-basic1"
  55. bool(true)
  56. bool(true)
  57. string(14) "session-basic1"
  58. *** Cleanup ***
  59. string(14) "session-basic1"
  60. bool(true)
  61. bool(true)