summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2013-07-22 08:22:22 +0200
committerOndřej Surý <ondrej@sury.org>2013-07-22 08:22:22 +0200
commitd837b4550418036e76d6adb3c7dad94b1e3a5a6a (patch)
tree1f1c808039c898d7d891975d3788531a2a6550f1 /tests
parent706ac6417162d94eb701952d40df136cd9528b56 (diff)
downloadphp-d837b4550418036e76d6adb3c7dad94b1e3a5a6a.tar.gz
New upstream version 5.5.1+dfsgupstream/5.5.1+dfsg
Diffstat (limited to 'tests')
-rw-r--r--tests/basic/bug45986.phpt2
-rw-r--r--tests/classes/array_conversion_keys.phpt18
-rw-r--r--tests/classes/private_members_serialization.phpt23
3 files changed, 42 insertions, 1 deletions
diff --git a/tests/basic/bug45986.phpt b/tests/basic/bug45986.phpt
index 1c30f1040..33c3f27ea 100644
--- a/tests/basic/bug45986.phpt
+++ b/tests/basic/bug45986.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #45986 (wrong error message for a non existant file on rename)
+Bug #45986 (wrong error message for a non existent file on rename)
--CREDITS--
Sebastian Schürmann
sebs@php.net
diff --git a/tests/classes/array_conversion_keys.phpt b/tests/classes/array_conversion_keys.phpt
new file mode 100644
index 000000000..e3bd7e033
--- /dev/null
+++ b/tests/classes/array_conversion_keys.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Verifies the correct conversion of objects to arrays
+--FILE--
+<?php
+class foo
+{
+ private $private = 'private';
+ protected $protected = 'protected';
+ public $public = 'public';
+}
+var_export((array) new foo);
+?>
+--EXPECTF--
+array (
+ '' . "\0" . 'foo' . "\0" . 'private' => 'private',
+ '' . "\0" . '*' . "\0" . 'protected' => 'protected',
+ 'public' => 'public',
+)
diff --git a/tests/classes/private_members_serialization.phpt b/tests/classes/private_members_serialization.phpt
new file mode 100644
index 000000000..c8dd3ab24
--- /dev/null
+++ b/tests/classes/private_members_serialization.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Verifies that it is possible to return private member names of parent classes in __sleep
+--FILE--
+<?php
+class foo
+{
+ private $private = 'private';
+ protected $protected = 'protected';
+ public $public = 'public';
+}
+
+class bar extends foo
+{
+ public function __sleep()
+ {
+ return array("\0foo\0private", 'protected', 'public');
+ }
+}
+
+var_dump(str_replace("\0", '\0', serialize(new bar())));
+?>
+--EXPECTF--
+string(114) "O:3:"bar":3:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";}"