Annotation of embedaddon/php/ext/reflection/tests/ReflectionClass_hasMethod_002.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: ReflectionClass::hasMethod() - error cases
3: --CREDITS--
4: Robin Fernandes <robinf@php.net>
5: Steve Seear <stevseea@php.net>
6: --FILE--
7: <?php
8: class C {
9: function f() {}
10: }
11:
12: $rc = new ReflectionClass("C");
13: echo "Check invalid params:\n";
14: var_dump($rc->hasMethod());
15: var_dump($rc->hasMethod("f", "f"));
16: var_dump($rc->hasMethod(null));
17: var_dump($rc->hasMethod(1));
18: var_dump($rc->hasMethod(1.5));
19: var_dump($rc->hasMethod(true));
20: var_dump($rc->hasMethod(array(1,2,3)));
21: var_dump($rc->hasMethod(new C));
22: ?>
23: --EXPECTF--
24: Check invalid params:
25:
26: Warning: ReflectionClass::hasMethod() expects exactly 1 parameter, 0 given in %s on line 8
27: NULL
28:
29: Warning: ReflectionClass::hasMethod() expects exactly 1 parameter, 2 given in %s on line 9
30: NULL
31: bool(false)
32: bool(false)
33: bool(false)
34: bool(false)
35:
36: Warning: ReflectionClass::hasMethod() expects parameter 1 to be string, array given in %s on line 14
37: NULL
38:
39: Warning: ReflectionClass::hasMethod() expects parameter 1 to be string, object given in %s on line 15
40: NULL
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>