summaryrefslogtreecommitdiff
path: root/ext/spl/tests/arrayObject___construct_basic1.phpt
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2009-04-10 14:09:48 +0200
committerSean Finney <seanius@debian.org>2009-04-10 14:09:48 +0200
commitcd0b49c72aee33b3e44a9c589fcd93b9e1c7a64f (patch)
tree1315c623bb7d9dfa8d366fa9cd2c6834ceeb5da5 /ext/spl/tests/arrayObject___construct_basic1.phpt
parent9ea47aab740772adf0c69d8c94b208a464e599ea (diff)
downloadphp-cd0b49c72aee33b3e44a9c589fcd93b9e1c7a64f.tar.gz
Imported Upstream version 5.2.9.dfsg.1upstream/5.2.9.dfsg.1
Diffstat (limited to 'ext/spl/tests/arrayObject___construct_basic1.phpt')
-rw-r--r--ext/spl/tests/arrayObject___construct_basic1.phpt37
1 files changed, 37 insertions, 0 deletions
diff --git a/ext/spl/tests/arrayObject___construct_basic1.phpt b/ext/spl/tests/arrayObject___construct_basic1.phpt
new file mode 100644
index 000000000..0d690fcda
--- /dev/null
+++ b/ext/spl/tests/arrayObject___construct_basic1.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SPL: ArrayObject::__construct basic usage.
+--FILE--
+<?php
+echo "--> No arguments:\n";
+var_dump(new ArrayObject());
+
+echo "--> Object argument:\n";
+$a = new stdClass;
+$a->p = 'hello';
+var_dump(new ArrayObject($a));
+
+echo "--> Array argument:\n";
+var_dump(new ArrayObject(array('key1' => 'val1')));
+
+echo "--> Nested ArrayObject argument:\n";
+var_dump(new ArrayObject(new ArrayObject($a)));
+?>
+--EXPECTF--
+--> No arguments:
+object(ArrayObject)#%d (0) {
+}
+--> Object argument:
+object(ArrayObject)#%d (1) {
+ ["p"]=>
+ string(5) "hello"
+}
+--> Array argument:
+object(ArrayObject)#%d (1) {
+ ["key1"]=>
+ string(4) "val1"
+}
+--> Nested ArrayObject argument:
+object(ArrayObject)#%d (1) {
+ ["p"]=>
+ string(5) "hello"
+}