Annotation of embedaddon/php/ext/reflection/tests/ReflectionProperty_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test ReflectionProperty class errors.
! 3: --FILE--
! 4: <?php
! 5:
! 6: class C {
! 7: public static $p;
! 8: }
! 9:
! 10: var_dump(new ReflectionProperty());
! 11: var_dump(new ReflectionProperty('C::p'));
! 12: var_dump(new ReflectionProperty('C', 'p', 'x'));
! 13: $rp = new ReflectionProperty('C', 'p');
! 14: var_dump($rp->getName(1));
! 15: var_dump($rp->isPrivate(1));
! 16: var_dump($rp->isProtected(1));
! 17: var_dump($rp->isPublic(1));
! 18: var_dump($rp->isStatic(1));
! 19: var_dump($rp->getModifiers(1));
! 20: var_dump($rp->isDefault(1));
! 21:
! 22: ?>
! 23: --EXPECTF--
! 24: Warning: ReflectionProperty::__construct() expects exactly 2 parameters, 0 given in %s on line %d
! 25: object(ReflectionProperty)#%d (2) {
! 26: ["name"]=>
! 27: string(0) ""
! 28: ["class"]=>
! 29: string(0) ""
! 30: }
! 31:
! 32: Warning: ReflectionProperty::__construct() expects exactly 2 parameters, 1 given in %s on line %d
! 33: object(ReflectionProperty)#%d (2) {
! 34: ["name"]=>
! 35: string(0) ""
! 36: ["class"]=>
! 37: string(0) ""
! 38: }
! 39:
! 40: Warning: ReflectionProperty::__construct() expects exactly 2 parameters, 3 given in %s on line %d
! 41: object(ReflectionProperty)#%d (2) {
! 42: ["name"]=>
! 43: string(0) ""
! 44: ["class"]=>
! 45: string(0) ""
! 46: }
! 47:
! 48: Warning: ReflectionProperty::getName() expects exactly 0 parameters, 1 given in %s on line %d
! 49: NULL
! 50:
! 51: Warning: ReflectionProperty::isPrivate() expects exactly 0 parameters, 1 given in %s on line %d
! 52: NULL
! 53:
! 54: Warning: ReflectionProperty::isProtected() expects exactly 0 parameters, 1 given in %s on line %d
! 55: NULL
! 56:
! 57: Warning: ReflectionProperty::isPublic() expects exactly 0 parameters, 1 given in %s on line %d
! 58: NULL
! 59:
! 60: Warning: ReflectionProperty::isStatic() expects exactly 0 parameters, 1 given in %s on line %d
! 61: NULL
! 62:
! 63: Warning: ReflectionProperty::getModifiers() expects exactly 0 parameters, 1 given in %s on line %d
! 64: NULL
! 65:
! 66: Warning: ReflectionProperty::isDefault() expects exactly 0 parameters, 1 given in %s on line %d
! 67: NULL
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>