mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Add session object deserialization test
This commit is contained in:
parent
5722a0e1ce
commit
72f99e668e
33
ext/session/tests/003.phpt
Normal file
33
ext/session/tests/003.phpt
Normal file
@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Session Object Deserialization
|
||||
--FILE--
|
||||
<?
|
||||
|
||||
class foo {
|
||||
var $bar = "ok";
|
||||
function method() { $this->yes++; }
|
||||
}
|
||||
|
||||
session_id("test");
|
||||
session_start();
|
||||
session_decode('baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}');
|
||||
|
||||
var_dump($baz);
|
||||
var_dump($arr);
|
||||
session_destroy();
|
||||
--EXPECT--
|
||||
object(foo)(2) {
|
||||
["bar"]=>
|
||||
string(2) "ok"
|
||||
["yes"]=>
|
||||
int(1)
|
||||
}
|
||||
array(1) {
|
||||
[3]=>
|
||||
object(foo)(2) {
|
||||
["bar"]=>
|
||||
string(2) "ok"
|
||||
["yes"]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user