Annotation of embedaddon/php/ext/session/tests/session_module_name_variation3.phpt, revision 1.1.1.1

1.1       misho       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>