diff options
Diffstat (limited to 'ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt')
-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 0000000..3118c17 --- /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. |