Annotation of embedaddon/php/ext/sqlite/tests/sqlite_session_001.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: sqlite, session storage test
! 3: --CREDITS--
! 4: Mats Lindh <mats at lindh.no>
! 5: #Testfest php.no
! 6: --INI--
! 7: session.save_handler = sqlite
! 8: --SKIPIF--
! 9: if (!extension_loaded("session"))
! 10: {
! 11: die("skip Session module not loaded");
! 12: }
! 13: if (!extension_loaded("sqlite"))
! 14: {
! 15: die("skip Session module not loaded");
! 16: }
! 17: --FILE--
! 18: <?php
! 19: /* Description: Tests that sqlite can be used as a session save handler
! 20: * Source code: ext/sqlite/sess_sqlite.c
! 21: */
! 22:
! 23: ob_start();
! 24: session_save_path(__DIR__ . "/sessiondb.sdb");
! 25:
! 26: // create the session and set a session value
! 27: session_start();
! 28: $_SESSION["test"] = "foo_bar";
! 29:
! 30: // close the session and unset the value
! 31: session_write_close();
! 32: unset($_SESSION["test"]);
! 33: var_dump(isset($_SESSION["test"]));
! 34:
! 35: // start the session again and check that we have the proper value
! 36: session_start();
! 37: var_dump($_SESSION["test"]);
! 38: ob_end_flush();
! 39: ?>
! 40: --EXPECTF--
! 41: bool(false)
! 42: %unicode|string%(7) "foo_bar"
! 43: --CLEAN--
! 44: <?php
! 45: unlink(__DIR__ . "/sessiondb.sdb")
! 46: ?>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>