diff options
author | Danack <Danack@basereality.com> | 2015-03-01 13:06:58 +0000 |
---|---|---|
committer | Danack <Danack@basereality.com> | 2015-03-01 13:06:58 +0000 |
commit | 043a02605f7bbf03f8a085354bfa617689a919d3 (patch) | |
tree | 111b4f4313792983fdb609150f9ebda4650ef939 /ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt | |
parent | b00cd68d7419bea8d8155ae585b85cf4f5fe8897 (diff) | |
download | php-git-043a02605f7bbf03f8a085354bfa617689a919d3.tar.gz |
Fixed ReflectionFunction, ReflectionMethod and ReflectionParameter.
Diffstat (limited to 'ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt')
-rw-r--r-- | ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt index 3118c17be8..1775dee514 100644 --- a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt +++ b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt @@ -6,7 +6,7 @@ ReflectionParameter::__construct(): Invalid method as constructor // Invalid class name try { new ReflectionParameter (array ('A', 'b'), 0); -} catch (ReflectionException $e) { echo $e->getMessage ()."\n"; } +} catch (ReflectionException $e) { echo $e->getMessage()."\n"; } // Invalid class method try { @@ -18,14 +18,31 @@ try { new ReflectionParameter (array (new C, 'b'), 0); } catch (ReflectionException $e) { echo $e->getMessage ()."\n"; } -echo "Done.\n"; class C { } +try { + new ReflectionParameter(array ('A', 'b')); +} +catch(ReflectionException $e) { + printf( "Ok - %s\n", $e->getMessage()); +} + +try { + new ReflectionParameter(0, 0); +} +catch(ReflectionException $e) { + printf( "Ok - %s\n", $e->getMessage()); +} + +echo "Done.\n"; + ?> --EXPECTF-- Class A does not exist Method C::b() does not exist Method C::b() does not exist +Ok - ReflectionParameter::__construct() expects exactly 2 parameters, 1 given +Ok - The parameter class is expected to be either a string, an array(class, method) or a callable object Done. |