Skip to content

Commit 3b43ec4

Browse files
committed
update incomplete class serialization tests
1 parent 56c1d74 commit 3b43ec4

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

ext/standard/tests/serialize/incomplete_class.phpt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
--FILE--
44
<?php
55

6-
$d = serialize(new __PHP_Incomplete_Class);
6+
$orig = unserialize('O:7:"Unknown":0:{}');
7+
$d = serialize($orig);
78
$o = unserialize($d);
89
var_dump($o);
910

@@ -18,13 +19,15 @@ var_dump($o->test2);
1819
echo "Done\n";
1920
?>
2021
--EXPECTF--
21-
object(__PHP_Incomplete_Class)#%d (0) {
22+
object(__PHP_Incomplete_Class)#%d (1) {
23+
["__PHP_Incomplete_Class_Name"]=>
24+
string(7) "Unknown"
2225
}
23-
The script tried to modify a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
26+
The script tried to modify a property on an incomplete object. Please ensure that the class definition "Unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
2427

25-
Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
28+
Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "Unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
2629
NULL
2730

28-
Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
31+
Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "Unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
2932
NULL
3033
Done

ext/standard/tests/serialize/serialization_objects_006.phpt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
Behaviour of incomplete class is preserved even when it was not created by unserialize().
33
--FILE--
44
<?php
5-
$a = new __PHP_Incomplete_Class;
5+
$a = unserialize('O:7:"Unknown":0:{}');
66
var_dump($a);
77
var_dump($a->p);
88

99
echo "Done";
1010
?>
1111
--EXPECTF--
12-
object(__PHP_Incomplete_Class)#%d (0) {
12+
object(__PHP_Incomplete_Class)#1 (1) {
13+
["__PHP_Incomplete_Class_Name"]=>
14+
string(7) "Unknown"
1315
}
1416

15-
Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
17+
Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "Unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
1618
NULL
1719
Done

0 commit comments

Comments
 (0)