diff options
| -rw-r--r-- | src/tests/unserialize_php8/equivalent.phpt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tests/unserialize_php8/equivalent.phpt b/src/tests/unserialize_php8/equivalent.phpt new file mode 100644 index 0000000..57dcf72 --- /dev/null +++ b/src/tests/unserialize_php8/equivalent.phpt | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | --TEST-- | ||
| 2 | Test idempotence of serialize+unserialize | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/config_serialize.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | class A { | ||
| 10 | public $pub = "public data"; | ||
| 11 | protected $prot = "protected data"; | ||
| 12 | private $priv = "private data"; | ||
| 13 | } | ||
| 14 | $a = new A; | ||
| 15 | if (unserialize(serialize($a)) == $a) { | ||
| 16 | echo "OK"; | ||
| 17 | } else { | ||
| 18 | echo "FAIL"; | ||
| 19 | } | ||
| 20 | ?> | ||
| 21 | --EXPECT-- | ||
| 22 | OK | ||
| 23 | |||
