summaryrefslogtreecommitdiff
path: root/ext/session/tests/bug80889.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/session/tests/bug80889.phpt')
-rw-r--r--ext/session/tests/bug80889.phpt37
1 files changed, 37 insertions, 0 deletions
diff --git a/ext/session/tests/bug80889.phpt b/ext/session/tests/bug80889.phpt
new file mode 100644
index 0000000000..78e1a6ab64
--- /dev/null
+++ b/ext/session/tests/bug80889.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Bug #80889 (Cannot set save handler when save_handler is invalid)
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--INI--
+session.save_handler=whatever
+--FILE--
+<?php
+class DummyHandler implements SessionHandlerInterface {
+ public function open($savePath, $sessionName) {
+ return true;
+ }
+ public function close() {
+ return true;
+ }
+ public function read($id) {
+ return '';
+ }
+ public function write($id, $data) {
+ return true;
+ }
+ public function destroy($id) {
+ return true;
+ }
+ public function gc($maxlifetime) {
+ return true;
+ }
+}
+
+$initHandler = ini_get('session.save_handler');
+session_set_save_handler(new DummyHandler());
+$setHandler = ini_get('session.save_handler');
+var_dump($initHandler, $setHandler);
+?>
+--EXPECT--
+string(8) "whatever"
+string(4) "user"