Annotation of embedaddon/php/ext/reflection/tests/004.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ReflectionMethod::invoke() with non object or null value
! 3: --FILE--
! 4: <?php
! 5:
! 6: class a {
! 7: function a(){
! 8: }
! 9: }
! 10: class b {
! 11: }
! 12:
! 13: $b = new b();
! 14:
! 15: $a=new ReflectionClass("a");
! 16: $m=$a->getMethod("a");
! 17:
! 18: try {
! 19: $m->invoke(null);
! 20: } catch (ReflectionException $E) {
! 21: echo $E->getMessage()."\n";
! 22: }
! 23:
! 24:
! 25: try {
! 26: $m->invoke($b);
! 27: } catch (ReflectionException $E) {
! 28: echo $E->getMessage()."\n";
! 29: }
! 30:
! 31: $b = new a();
! 32: try {
! 33: $m->invoke($b);
! 34: } catch (ReflectionException $E) {
! 35: echo $E->getMessage()."\n";
! 36: }
! 37:
! 38: echo "===DONE===\n";?>
! 39: --EXPECT--
! 40: Non-object passed to Invoke()
! 41: Given object is not an instance of the class this method was declared in
! 42: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>