File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / session / tests / session_module_name_variation3.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:01 2012 UTC (12 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Test session_module_name() function : variation
    3: --INI--
    4: session.save_path=
    5: session.name=PHPSESSID
    6: --SKIPIF--
    7: <?php include('skipif.inc'); ?>
    8: --FILE--
    9: <?php
   10: 
   11: ob_start();
   12: 
   13: /* 
   14:  * Prototype : string session_module_name([string $module])
   15:  * Description : Get and/or set the current session module
   16:  * Source code : ext/session/session.c 
   17:  */
   18: 
   19: echo "*** Testing session_module_name() : variation ***\n";
   20: function open($save_path, $session_name) { 
   21:     throw new Exception("Stop...!");
   22: }
   23: 
   24: function close() { }
   25: function read($id) { }
   26: function write($id, $session_data) { }
   27: function destroy($id) { }
   28: function gc($maxlifetime) { }
   29: 
   30: var_dump(session_module_name("files"));
   31: session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
   32: var_dump(session_module_name());
   33: var_dump(session_start());
   34: var_dump(session_module_name());
   35: var_dump(session_destroy());
   36: 
   37: ob_end_flush();
   38: ?>
   39: --EXPECTF--
   40: *** Testing session_module_name() : variation ***
   41: string(%d) "%s"
   42: string(4) "user"
   43: 
   44: Fatal error: Uncaught exception 'Exception' with message 'Stop...!' in %s:%d
   45: Stack trace:
   46: #0 [internal function]: open('', 'PHPSESSID')
   47: #1 %s(%d): session_start()
   48: #2 {main}
   49:   thrown in %s on line %d

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>