diff options
| author | Christian Seiler <cseiler@php.net> | 2008-08-11 22:08:58 +0000 |
|---|---|---|
| committer | Christian Seiler <cseiler@php.net> | 2008-08-11 22:08:58 +0000 |
| commit | b9ab70c0d24ee9da0db69fe306c16af113f1f7aa (patch) | |
| tree | 22c59212fa9d008ebc9e9d23d7eff1c1d1c1d010 /ext/reflection/tests | |
| parent | b28b6977bf0f38fb5d423467108825b368faa033 (diff) | |
| download | php-git-b9ab70c0d24ee9da0db69fe306c16af113f1f7aa.tar.gz | |
- Fixed segmentation fault (test added)
Diffstat (limited to 'ext/reflection/tests')
| -rw-r--r-- | ext/reflection/tests/reflectionParameter_invalidMethodInConstructor.phpt | 31 |
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. |
