summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/reflectionObject_constructor_error.phpt
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:38:07 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:38:07 -0400
commitbb01389fbd53ec1cbcb80d0681a37cca1267891a (patch)
tree4783178fca65a5d9071c8df34f2ddc3d31728673 /ext/reflection/tests/reflectionObject_constructor_error.phpt
parenteddbbea4325e602ddc87c545531609132d4f0e3b (diff)
downloadphp-bb01389fbd53ec1cbcb80d0681a37cca1267891a.tar.gz
Imported Upstream version 5.2.4upstream/5.2.4
Diffstat (limited to 'ext/reflection/tests/reflectionObject_constructor_error.phpt')
-rw-r--r--ext/reflection/tests/reflectionObject_constructor_error.phpt49
1 files changed, 49 insertions, 0 deletions
diff --git a/ext/reflection/tests/reflectionObject_constructor_error.phpt b/ext/reflection/tests/reflectionObject_constructor_error.phpt
new file mode 100644
index 000000000..baa6129ed
--- /dev/null
+++ b/ext/reflection/tests/reflectionObject_constructor_error.phpt
@@ -0,0 +1,49 @@
+--TEST--
+ReflectionObject::__construct - invalid arguments
+--FILE--
+<?php
+
+var_dump(new ReflectionObject());
+var_dump(new ReflectionObject('stdClass'));
+$myInstance = new stdClass;
+var_dump(new ReflectionObject($myInstance, $myInstance));
+var_dump(new ReflectionObject(0));
+var_dump(new ReflectionObject(null));
+var_dump(new ReflectionObject(array(1,2)));
+?>
+--EXPECTF--
+Warning: ReflectionObject::__construct() expects exactly 1 parameter, 0 given in %s on line 3
+object(ReflectionObject)#%d (1) {
+ ["name"]=>
+ string(0) ""
+}
+
+Warning: ReflectionObject::__construct() expects parameter 1 to be object, string given in %s on line 4
+object(ReflectionObject)#%d (1) {
+ ["name"]=>
+ string(0) ""
+}
+
+Warning: ReflectionObject::__construct() expects exactly 1 parameter, 2 given in %s on line 6
+object(ReflectionObject)#%d (1) {
+ ["name"]=>
+ string(0) ""
+}
+
+Warning: ReflectionObject::__construct() expects parameter 1 to be object, integer given in %s on line 7
+object(ReflectionObject)#%d (1) {
+ ["name"]=>
+ string(0) ""
+}
+
+Warning: ReflectionObject::__construct() expects parameter 1 to be object, null given in %s on line 8
+object(ReflectionObject)#%d (1) {
+ ["name"]=>
+ string(0) ""
+}
+
+Warning: ReflectionObject::__construct() expects parameter 1 to be object, array given in %s on line 9
+object(ReflectionObject)#%d (1) {
+ ["name"]=>
+ string(0) ""
+}