com php-src: Renamed test case to match with reported bug: ext/standard/tests/serialize/bug69210.phpt ext/standard/tests/s
erialize/serialization_objects_016.phpt

From: Date: Tue, 10 Mar 2015 04:01:26 +0000
Subject: com php-src: Renamed test case to match with reported bug: ext/standard/tests/serialize/bug69210.phpt ext/standard/tests/s
erialize/serialization_objects_016.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85786@lists.php.net to get a copy of this message
Commit: 6b7b5e777fc538ae6e62318587c3592ac37b7123 Author: Juan Basso <jrbasso@gmail.com> Tue, 10 Mar 2015 00:01:26 -0400 Parents: cbdeccd6edbd08b954f7f915d0d99a7e787f0fb6 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6b7b5e777fc538ae6e62318587c3592ac37b7123 Log: Renamed test case to match with reported bug Changed paths: A ext/standard/tests/serialize/bug69210.phpt D ext/standard/tests/serialize/serialization_objects_016.phpt Diff: diff --git a/ext/standard/tests/serialize/bug69210.phpt b/ext/standard/tests/serialize/bug69210.phpt new file mode 100644 index 0000000...e9b6bf2 --- /dev/null +++ b/ext/standard/tests/serialize/bug69210.phpt @@ -0,0 +1,51 @@ +--TEST-- +serialize() integrity with non string on __sleep +--FILE-- +<?php +class testString +{ + public $a = true; + + public function __sleep() + { + return array('a', '1'); + } +} + +class testInteger +{ + public $a = true; + + public function __sleep() + { + return array('a', 1); + } +} + +$cs = new testString(); +$ci = new testInteger(); + +$ss = @serialize($cs); +echo $ss . "\n"; + +$si = @serialize($ci); +echo $si . "\n"; + +var_dump(unserialize($ss)); +var_dump(unserialize($si)); +?> +--EXPECT-- +O:10:"testString":2:{s:1:"a";b:1;s:1:"1";N;} +O:11:"testInteger":2:{s:1:"a";b:1;s:1:"1";N;} +object(testString)#3 (2) { + ["a"]=> + bool(true) + ["1"]=> + NULL +} +object(testInteger)#3 (2) { + ["a"]=> + bool(true) + ["1"]=> + NULL +} \ No newline at end of file diff --git a/ext/standard/tests/serialize/serialization_objects_016.phpt b/ext/standard/tests/serialize/serialization_objects_016.phpt deleted file mode 100644 index e9b6bf2..0000000 --- a/ext/standard/tests/serialize/serialization_objects_016.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -serialize() integrity with non string on __sleep ---FILE-- -<?php -class testString -{ - public $a = true; - - public function __sleep() - { - return array('a', '1'); - } -} - -class testInteger -{ - public $a = true; - - public function __sleep() - { - return array('a', 1); - } -} - -$cs = new testString(); -$ci = new testInteger(); - -$ss = @serialize($cs); -echo $ss . "\n"; - -$si = @serialize($ci); -echo $si . "\n"; - -var_dump(unserialize($ss)); -var_dump(unserialize($si)); -?> ---EXPECT-- -O:10:"testString":2:{s:1:"a";b:1;s:1:"1";N;} -O:11:"testInteger":2:{s:1:"a";b:1;s:1:"1";N;} -object(testString)#3 (2) { - ["a"]=> - bool(true) - ["1"]=> - NULL -} -object(testInteger)#3 (2) { - ["a"]=> - bool(true) - ["1"]=> - NULL -} \ No newline at end of file

« previous php.cvs (#85786) next »