1--TEST--
2ReflectionParameter::__construct(): Invalid method as constructor
3--FILE--
4<?php
5
6// Invalid class name
7try {
8	new ReflectionParameter (array ('A', 'b'), 0);
9} catch (ReflectionException $e) { echo $e->getMessage()."\n"; }
10
11// Invalid class method
12try {
13	new ReflectionParameter (array ('C', 'b'), 0);
14} catch (ReflectionException $e) { echo $e->getMessage ()."\n"; }
15
16// Invalid object method
17try {
18	new ReflectionParameter (array (new C, 'b'), 0);
19} catch (ReflectionException $e) { echo $e->getMessage ()."\n"; }
20
21
22class C {
23}
24
25try {
26	new ReflectionParameter(array ('A', 'b'));
27}
28catch(TypeError $e) {
29	printf( "Ok - %s\n", $e->getMessage());
30}
31
32try {
33	new ReflectionParameter(0, 0);
34}
35catch(ReflectionException $e) {
36	printf( "Ok - %s\n", $e->getMessage());
37}
38
39echo "Done.\n";
40
41?>
42--EXPECT--
43Class A does not exist
44Method C::b() does not exist
45Method C::b() does not exist
46Ok - ReflectionParameter::__construct() expects exactly 2 parameters, 1 given
47Ok - The parameter class is expected to be either a string, an array(class, method) or a callable object
48Done.
49