summaryrefslogtreecommitdiff
path: root/ext/reflection/tests
diff options
context:
space:
mode:
authorChristian Seiler <cseiler@php.net>2008-08-11 22:08:58 +0000
committerChristian Seiler <cseiler@php.net>2008-08-11 22:08:58 +0000
commitb9ab70c0d24ee9da0db69fe306c16af113f1f7aa (patch)
tree22c59212fa9d008ebc9e9d23d7eff1c1d1c1d010 /ext/reflection/tests
parentb28b6977bf0f38fb5d423467108825b368faa033 (diff)
downloadphp-git-b9ab70c0d24ee9da0db69fe306c16af113f1f7aa.tar.gz
- Fixed segmentation fault (test added)
Diffstat (limited to 'ext/reflection/tests')
-rw-r--r--ext/reflection/tests/reflectionParameter_invalidMethodInConstructor.phpt31
1 files changed, 31 insertions, 0 deletions
diff --git a/ext/reflection/tests/reflectionParameter_invalidMethodInConstructor.phpt b/ext/reflection/tests/reflectionParameter_invalidMethodInConstructor.phpt
new file mode 100644
index 0000000000..3118c17be8
--- /dev/null
+++ b/ext/reflection/tests/reflectionParameter_invalidMethodInConstructor.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ReflectionParameter::__construct(): Invalid method as constructor
+--FILE--
+<?php
+
+// Invalid class name
+try {
+ new ReflectionParameter (array ('A', 'b'), 0);
+} catch (ReflectionException $e) { echo $e->getMessage ()."\n"; }
+
+// Invalid class method
+try {
+ new ReflectionParameter (array ('C', 'b'), 0);
+} catch (ReflectionException $e) { echo $e->getMessage ()."\n"; }
+
+// Invalid object method
+try {
+ new ReflectionParameter (array (new C, 'b'), 0);
+} catch (ReflectionException $e) { echo $e->getMessage ()."\n"; }
+
+echo "Done.\n";
+
+class C {
+}
+
+?>
+--EXPECTF--
+Class A does not exist
+Method C::b() does not exist
+Method C::b() does not exist
+Done.