Annotation of embedaddon/php/ext/session/tests/session_set_save_handler_class_005.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test session_set_save_handler() : incomplete implementation
! 3: --INI--
! 4: session.save_handler=files
! 5: session.name=PHPSESSID
! 6: --SKIPIF--
! 7: <?php include('skipif.inc'); ?>
! 8: --FILE--
! 9: <?php
! 10:
! 11: ob_start();
! 12:
! 13: /*
! 14: * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
! 15: * Description : Sets user-level session storage functions
! 16: * Source code : ext/session/session.c
! 17: */
! 18:
! 19: echo "*** Testing session_set_save_handler() : incomplete implementation ***\n";
! 20:
! 21: class MySession6 extends SessionHandler {
! 22: public function open($path, $name) {
! 23: // don't call parent
! 24: return true;
! 25: }
! 26:
! 27: public function read($id) {
! 28: // should error because parent::open hasn't been called
! 29: return parent::read($id);
! 30: }
! 31: }
! 32:
! 33: $handler = new MySession6;
! 34: session_set_save_handler($handler);
! 35: session_start();
! 36:
! 37: var_dump(session_id(), ini_get('session.save_handler'), $_SESSION);
! 38:
! 39: session_write_close();
! 40: session_unset();
! 41:
! 42:
! 43: --EXPECTF--
! 44: *** Testing session_set_save_handler() : incomplete implementation ***
! 45:
! 46: Warning: SessionHandler::read(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d
! 47: string(%d) "%s"
! 48: string(4) "user"
! 49: array(0) {
! 50: }
! 51:
! 52: Warning: SessionHandler::write(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d
! 53:
! 54: Warning: SessionHandler::close(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>