com php-src: Add test for Bug #70133 (Extended SessionHandler::read is ignoring $session_id when calling parent): ext/ session/tests/bug70133.phpt
| From: | Yasuo Ohgaki | Date: | Fri, 15 Jan 2016 20:29:19 +0000 |
| Subject: | com php-src: Add test for Bug #70133 (Extended SessionHandler::read is ignoring $session_id when calling parent): ext/ session/tests/bug70133.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90666@lists.php.net to get a copy of this message | ||
Commit: 9f2240963f75aa1d15c3ae2485e61635ec2c24fa
Author: Yasuo Ohgaki <yohgaki@php.net> Sat, 16 Jan 2016 05:29:06 +0900
Parents: 93db2dac48bc9e49c4f44882b27d5ab71a5c2d05
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9f2240963f75aa1d15c3ae2485e61635ec2c24fa
Log:
Add test for Bug #70133 (Extended SessionHandler::read is ignoring $session_id when calling parent)
Bugs:
https://bugs.php.net/70133
Changed paths:
A ext/session/tests/bug70133.phpt
Diff:
diff --git a/ext/session/tests/bug70133.phpt b/ext/session/tests/bug70133.phpt
new file mode 100644
index 0000000...3e019e4
--- /dev/null
+++ b/ext/session/tests/bug70133.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Bug #70133 (Extended SessionHandler::read is ignoring $session_id when calling parent)
+--SKIPIF--
+<?php include('skipif..inc'); ?>
+--INI--
+session.save_handler=files
+session.save_path=
+session.use_strict_mode=0
+--FILE--
+<?php
+
+class CustomReadHandler extends \SessionHandler {
+
+ public function read($session_id) {
+ return parent::read('mycustomsession');
+ }
+}
+
+ob_start();
+
+session_set_save_handler(new CustomReadHandler(), true);
+
+session_id('mycustomsession');
+session_start();
+$_SESSION['foo'] = 'hoge';
+var_dump(session_id());
+session_commit();
+
+session_id('otherid');
+session_start();
+var_dump($_SESSION);
+var_dump(session_id());
+
+?>
+--EXPECT--
+string(15) "mycustomsession"
+array(1) {
+ ["foo"]=>
+ string(4) "hoge"
+}
+string(7) "otherid"