Annotation of embedaddon/php/ext/session/tests/session_set_save_handler_error2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test session_set_save_handler() function : error functionality
3: --SKIPIF--
4: <?php include('skipif.inc'); ?>
5: --FILE--
6: <?php
7:
8: ob_start();
9:
10: /*
11: * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
12: * Description : Sets user-level session storage functions
13: * Source code : ext/session/session.c
14: */
15:
16: echo "*** Testing session_set_save_handler() : error functionality ***\n";
17:
18: function open($save_path, $session_name) { return true; }
19: function close() { return true; }
20: function read($id) { return false; }
21: function write($id, $session_data) { }
22: function destroy($id) { return true; }
23: function gc($maxlifetime) { return true; }
24:
25: session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
26:
27: session_start();
28: $_SESSION["Blah"] = "Hello World!";
29: $_SESSION["Foo"] = FALSE;
30: $_SESSION["Guff"] = 1234567890;
31: var_dump($_SESSION);
32:
33: session_write_close();
34: var_dump($_SESSION);
35: session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
36: session_start();
37: var_dump($_SESSION);
38: session_destroy();
39:
40: ob_end_flush();
41: ?>
42: --EXPECTF--
43: *** Testing session_set_save_handler() : error functionality ***
44: array(3) {
45: ["Blah"]=>
46: string(12) "Hello World!"
47: ["Foo"]=>
48: bool(false)
49: ["Guff"]=>
50: int(1234567890)
51: }
52: array(3) {
53: ["Blah"]=>
54: string(12) "Hello World!"
55: ["Foo"]=>
56: bool(false)
57: ["Guff"]=>
58: int(1234567890)
59: }
60: array(0) {
61: }
62:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>