Skip to content

Commit b165197

Browse files
committed
Fix session cleanup
1 parent 9bba9f6 commit b165197

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ext/session/tests/session_set_save_handler_closures.phpt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ var_dump(session_module_name(FALSE));
1919
var_dump(session_module_name("blah"));
2020
var_dump(session_module_name("foo"));
2121

22-
$path = __DIR__;
22+
$path = __DIR__ . '/session_set_save_handler_closures';
23+
@mkdir($path);
2324
session_save_path($path);
2425
session_set_save_handler($open_closure, $close_closure, $read_closure, $write_closure, $destroy_closure, $gc_closure);
2526

@@ -41,7 +42,12 @@ $_SESSION['Bar'] = 'Foo';
4142
var_dump($_SESSION);
4243
session_write_close();
4344

45+
echo "Cleanup\n";
46+
session_start();
47+
session_destroy();
48+
4449
ob_end_flush();
50+
@rmdir($path);
4551
?>
4652
--EXPECTF--
4753
*** Testing session_set_save_handler() : using closures as callbacks ***
@@ -90,3 +96,8 @@ array(4) {
9096
}
9197
Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;Bar|s:3:"Foo";]
9298
Close [%s,PHPSESSID]
99+
Cleanup
100+
Open [%s,PHPSESSID]
101+
Read [%s,%s]
102+
Destroy [%s,%s]
103+
Close [%s,PHPSESSID]

0 commit comments

Comments
 (0)