From: Zoe Slattery Date: Thu, 12 Jul 2007 21:03:39 +0000 (+0000) Subject: reflectionObject tests X-Git-Tag: php-5.2.4RC1~163 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55ff728d73b950402490b70f3660fbbadf2270a6;p=php reflectionObject tests --- diff --git a/ext/reflection/tests/reflectionObject_FileInfo_basic.phpt b/ext/reflection/tests/reflectionObject_FileInfo_basic.phpt new file mode 100644 index 0000000000..a1334f4d65 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_FileInfo_basic.phpt @@ -0,0 +1,25 @@ +--TEST-- +ReflectionObject::getFileName(), ReflectionObject::getStartLine(), ReflectionObject::getEndLine() - basic function +--FILE-- +getFileName()); +var_dump($rc->getStartLine()); +var_dump($rc->getEndLine()); + +$rc = new ReflectionObject(new stdclass); +var_dump($rc->getFileName()); +var_dump($rc->getStartLine()); +var_dump($rc->getEndLine()); + +Class C { + +} +?> +--EXPECTF-- +string(%d) "%sreflectionObject_FileInfo_basic.php" +int(12) +int(14) +bool(false) +bool(false) +bool(false) diff --git a/ext/reflection/tests/reflectionObject_FileInfo_error.phpt b/ext/reflection/tests/reflectionObject_FileInfo_error.phpt new file mode 100644 index 0000000000..f66d2fb59e --- /dev/null +++ b/ext/reflection/tests/reflectionObject_FileInfo_error.phpt @@ -0,0 +1,37 @@ +--TEST-- +ReflectionObject::getFileName(), ReflectionObject::getStartLine(), ReflectionObject::getEndLine() -invalid aparams +--FILE-- +$method()); + var_dump($rc->$method(null)); + var_dump($rc->$method('X', 0)); +} +?> +--EXPECTF-- +string(%d) "%s" + +Warning: Wrong parameter count for ReflectionClass::getFileName() in %s on line 9 +NULL + +Warning: Wrong parameter count for ReflectionClass::getFileName() in %s on line 10 +NULL +int(2) + +Warning: Wrong parameter count for ReflectionClass::getStartLine() in %s on line 9 +NULL + +Warning: Wrong parameter count for ReflectionClass::getStartLine() in %s on line 10 +NULL +int(2) + +Warning: Wrong parameter count for ReflectionClass::getEndLine() in %s on line 9 +NULL + +Warning: Wrong parameter count for ReflectionClass::getEndLine() in %s on line 10 +NULL diff --git a/ext/reflection/tests/reflectionObject_constructor_basic.phpt b/ext/reflection/tests/reflectionObject_constructor_basic.phpt new file mode 100644 index 0000000000..8f4a9082c9 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_constructor_basic.phpt @@ -0,0 +1,28 @@ +--TEST-- +ReflectionObject::__construct - basic function test +--FILE-- + +--EXPECTF-- +object(ReflectionObject)#%d (1) { + ["name"]=> + string(8) "stdClass" +} +object(ReflectionObject)#%d (1) { + ["name"]=> + string(1) "C" +} +object(ReflectionObject)#%d (1) { + ["name"]=> + string(16) "ReflectionObject" +} diff --git a/ext/reflection/tests/reflectionObject_constructor_error.phpt b/ext/reflection/tests/reflectionObject_constructor_error.phpt new file mode 100644 index 0000000000..baa6129edf --- /dev/null +++ b/ext/reflection/tests/reflectionObject_constructor_error.phpt @@ -0,0 +1,49 @@ +--TEST-- +ReflectionObject::__construct - invalid arguments +--FILE-- + +--EXPECTF-- +Warning: ReflectionObject::__construct() expects exactly 1 parameter, 0 given in %s on line 3 +object(ReflectionObject)#%d (1) { + ["name"]=> + string(0) "" +} + +Warning: ReflectionObject::__construct() expects parameter 1 to be object, string given in %s on line 4 +object(ReflectionObject)#%d (1) { + ["name"]=> + string(0) "" +} + +Warning: ReflectionObject::__construct() expects exactly 1 parameter, 2 given in %s on line 6 +object(ReflectionObject)#%d (1) { + ["name"]=> + string(0) "" +} + +Warning: ReflectionObject::__construct() expects parameter 1 to be object, integer given in %s on line 7 +object(ReflectionObject)#%d (1) { + ["name"]=> + string(0) "" +} + +Warning: ReflectionObject::__construct() expects parameter 1 to be object, null given in %s on line 8 +object(ReflectionObject)#%d (1) { + ["name"]=> + string(0) "" +} + +Warning: ReflectionObject::__construct() expects parameter 1 to be object, array given in %s on line 9 +object(ReflectionObject)#%d (1) { + ["name"]=> + string(0) "" +} diff --git a/ext/reflection/tests/reflectionObject_getConstant_basic.phpt b/ext/reflection/tests/reflectionObject_getConstant_basic.phpt new file mode 100644 index 0000000000..3d151bc7d5 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_getConstant_basic.phpt @@ -0,0 +1,41 @@ +--TEST-- +ReflectionObject::getConstant() basic function test +--FILE-- +getConstant('a')); + var_dump($rc->getConstant('doesntexist')); +} +?> +--EXPECTF-- +Reflecting on instance of class C: +string(12) "hello from C" +bool(false) +Reflecting on instance of class D: +string(12) "hello from C" +bool(false) +Reflecting on instance of class E: +string(12) "hello from C" +bool(false) +Reflecting on instance of class F: +string(12) "hello from F" +bool(false) +Reflecting on instance of class X: +bool(false) +bool(false) diff --git a/ext/reflection/tests/reflectionObject_getConstant_error.phpt b/ext/reflection/tests/reflectionObject_getConstant_error.phpt new file mode 100644 index 0000000000..3f12f3a1ea --- /dev/null +++ b/ext/reflection/tests/reflectionObject_getConstant_error.phpt @@ -0,0 +1,34 @@ +--TEST-- +ReflectionObject::getConstant() - invalid params +--FILE-- +getConstant()); +var_dump($rc->getConstant("myConst", "myConst")); +var_dump($rc->getConstant(null)); +var_dump($rc->getConstant(1)); +var_dump($rc->getConstant(1.5)); +var_dump($rc->getConstant(true)); +var_dump($rc->getConstant(array(1,2,3))); +var_dump($rc->getConstant(new C)); +?> +--EXPECTF-- +Warning: ReflectionClass::getConstant() expects exactly 1 parameter, 0 given in %s on line 7 +NULL + +Warning: ReflectionClass::getConstant() expects exactly 1 parameter, 2 given in %s on line 8 +NULL +bool(false) +bool(false) +bool(false) +bool(false) + +Warning: ReflectionClass::getConstant() expects parameter 1 to be string, array given in %s on line 13 +NULL + +Warning: ReflectionClass::getConstant() expects parameter 1 to be string, object given in %s on line 14 +NULL diff --git a/ext/reflection/tests/reflectionObject_getConstants_basic.phpt b/ext/reflection/tests/reflectionObject_getConstants_basic.phpt new file mode 100644 index 0000000000..6479ec90ed --- /dev/null +++ b/ext/reflection/tests/reflectionObject_getConstants_basic.phpt @@ -0,0 +1,49 @@ +--TEST-- +ReflectionObject::getConstants() - basic function test +--FILE-- +getConstants()); +} + +?> +--EXPECTF-- +Reflecting on instance of class C: +array(1) { + ["a"]=> + string(12) "hello from C" +} +Reflecting on instance of class D: +array(1) { + ["a"]=> + string(12) "hello from C" +} +Reflecting on instance of class E: +array(1) { + ["a"]=> + string(12) "hello from C" +} +Reflecting on instance of class F: +array(1) { + ["a"]=> + string(12) "hello from F" +} +Reflecting on instance of class X: +array(0) { +} diff --git a/ext/reflection/tests/reflectionObject_getConstants_error.phpt b/ext/reflection/tests/reflectionObject_getConstants_error.phpt new file mode 100644 index 0000000000..81ec9ed2ed --- /dev/null +++ b/ext/reflection/tests/reflectionObject_getConstants_error.phpt @@ -0,0 +1,18 @@ +--TEST-- +ReflectionObject::getConstants() - invalid params +--FILE-- +getConstants('X'); +$rc->getConstants(true); + +?> +--EXPECTF-- +Warning: Wrong parameter count for ReflectionClass::getConstants() in %s on line 7 + +Warning: Wrong parameter count for ReflectionClass::getConstants() in %s on line 8 + diff --git a/ext/reflection/tests/reflectionObject_getConstructor_basic.phpt b/ext/reflection/tests/reflectionObject_getConstructor_basic.phpt new file mode 100644 index 0000000000..a784f6d9e0 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_getConstructor_basic.phpt @@ -0,0 +1,82 @@ +--TEST-- +ReflectionObject::getConstructor() - basic function test +--FILE-- +getConstructor(); + if ($rm != null) { + echo "Constructor of $class: " . $rm->getName() . "\n"; + } else { + echo "No constructor for $class\n"; + } + +} + +?> +--EXPECTF-- + +Strict Standards: Redefining already defined constructor for class OldAndNewCtor in %s on line 26 + +Strict Standards: %s for class NewAndOldCtor in %s on line 31 +Constructor of NewCtor: __construct +Constructor of ExtendsNewCtor: __construct +Constructor of OldCtor: OldCtor +Constructor of ExtendsOldCtor: OldCtor +Constructor of OldAndNewCtor: __construct +Constructor of NewAndOldCtor: __construct +Constructor of B: B +Constructor of C: C +Constructor of D1: __construct +Constructor of D2: C +No constructor for X +No constructor for Y diff --git a/ext/reflection/tests/reflectionObject_getConstructor_error.phpt b/ext/reflection/tests/reflectionObject_getConstructor_error.phpt new file mode 100644 index 0000000000..5cabc2ed10 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_getConstructor_error.phpt @@ -0,0 +1,24 @@ +--TEST-- +ReflectionObject::getConstructor() - invalid params +--FILE-- +getConstructor(null)); +var_dump($rc->getConstructor('X')); +var_dump($rc->getConstructor(true)); +var_dump($rc->getConstructor(array(1,2,3))); +?> +--EXPECTF-- + +Warning: Wrong parameter count for ReflectionClass::getConstructor() in %s on line 4 +NULL + +Warning: Wrong parameter count for ReflectionClass::getConstructor() in %s on line 5 +NULL + +Warning: Wrong parameter count for ReflectionClass::getConstructor() in %s on line 6 +NULL + +Warning: Wrong parameter count for ReflectionClass::getConstructor() in %s on line 7 +NULL diff --git a/ext/reflection/tests/reflectionObject_getName_basic.phpt b/ext/reflection/tests/reflectionObject_getName_basic.phpt new file mode 100644 index 0000000000..db0cbfb08d --- /dev/null +++ b/ext/reflection/tests/reflectionObject_getName_basic.phpt @@ -0,0 +1,27 @@ +--TEST-- +ReflectionObject::getName() - basic function test +--FILE-- +getName()); + +$r1 = new ReflectionObject(new stdClass); +var_dump($r1->getName()); + +class C { } +$myInstance = new C; +$r2 = new ReflectionObject($myInstance); +var_dump($r2->getName()); + +$r3 = new ReflectionObject($r2); +var_dump($r3->getName()); + +?> +--EXPECTF-- + +Warning: ReflectionObject::__construct() expects exactly 1 parameter, 0 given in %s on line 2 +string(0) "" +string(8) "stdClass" +string(1) "C" +string(16) "ReflectionObject" + diff --git a/ext/reflection/tests/reflectionObject_getName_error.phpt b/ext/reflection/tests/reflectionObject_getName_error.phpt new file mode 100644 index 0000000000..eb64244c15 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_getName_error.phpt @@ -0,0 +1,23 @@ +--TEST-- +ReflectionObject::getname() - invalid params +--FILE-- +getName(null)); +var_dump($r3->getName('x','y')); +var_dump($r3->getName(0)); +?> +--EXPECTF-- +Warning: Wrong parameter count for ReflectionClass::getName() in %s on line 8 +NULL + +Warning: Wrong parameter count for ReflectionClass::getName() in %s on line 9 +NULL + +Warning: Wrong parameter count for ReflectionClass::getName() in %s on line 10 +NULL diff --git a/ext/reflection/tests/reflectionObject_getName_error1.phpt b/ext/reflection/tests/reflectionObject_getName_error1.phpt new file mode 100644 index 0000000000..26c342d7f4 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_getName_error1.phpt @@ -0,0 +1,8 @@ +--TEST-- +ReflectionObject::getName - forbid static invocation +--FILE-- + +--EXPECTF-- +Fatal error: Non-static method ReflectionClass::getName() cannot be called statically in %s on line 2 diff --git a/ext/reflection/tests/reflectionObject_isInstance_basic.phpt b/ext/reflection/tests/reflectionObject_isInstance_basic.phpt new file mode 100644 index 0000000000..51d42fdf98 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_isInstance_basic.phpt @@ -0,0 +1,33 @@ +--TEST-- +ReflectionObject::isInstance() - basic function test +--FILE-- + new A, + "myB" => new B, + "myX" => new X ); + +foreach ($classes as $class) { + $ro = new ReflectionObject(new $class); + foreach ($instances as $name => $instance) { + echo "is $name a $class? "; + var_dump($ro->isInstance($instance)); + } +} + +?> +--EXPECTF-- +is myA a A? bool(true) +is myB a A? bool(false) +is myX a A? bool(false) +is myA a B? bool(false) +is myB a B? bool(true) +is myX a B? bool(false) +is myA a X? bool(false) +is myB a X? bool(false) +is myX a X? bool(true) diff --git a/ext/reflection/tests/reflectionObject_isInstance_error.phpt b/ext/reflection/tests/reflectionObject_isInstance_error.phpt new file mode 100644 index 0000000000..692c2f8496 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_isInstance_error.phpt @@ -0,0 +1,38 @@ +--TEST-- +ReflectionObject::isInstance() - invalid params +--FILE-- +isInstance()); +var_dump($ro->isInstance($instance, $instance)); +var_dump($ro->isInstance(1)); +var_dump($ro->isInstance(1.5)); +var_dump($ro->isInstance(true)); +var_dump($ro->isInstance('X')); +var_dump($ro->isInstance(null)); + +?> +--EXPECTF-- +Warning: ReflectionClass::isInstance() expects exactly 1 parameter, 0 given in %s on line 6 +NULL + +Warning: ReflectionClass::isInstance() expects exactly 1 parameter, 2 given in %s on line 7 +NULL + +Warning: ReflectionClass::isInstance() expects parameter 1 to be object, integer given in %s on line 8 +NULL + +Warning: ReflectionClass::isInstance() expects parameter 1 to be object, double given in %s on line 9 +NULL + +Warning: ReflectionClass::isInstance() expects parameter 1 to be object, boolean given in %s on line 10 +NULL + +Warning: ReflectionClass::isInstance() expects parameter 1 to be object, string given in %s on line 11 +NULL + +Warning: ReflectionClass::isInstance() expects parameter 1 to be object, null given in %s on line 12 +NULL diff --git a/ext/reflection/tests/reflectionObject_isInstantiable_basic.phpt b/ext/reflection/tests/reflectionObject_isInstantiable_basic.phpt new file mode 100644 index 0000000000..4b8a6ec221 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_isInstantiable_basic.phpt @@ -0,0 +1,36 @@ +--TEST-- +ReflectionObject::IsInstantiable() - basic function test +--FILE-- +IsInstantiable()); +} +?> +--EXPECTF-- +Is C instantiable? bool(true) +Is ifaceImpl instantiable? bool(true) +Is D instantiable? bool(true) diff --git a/ext/reflection/tests/reflectionObject_isInstantiable_error.phpt b/ext/reflection/tests/reflectionObject_isInstantiable_error.phpt new file mode 100644 index 0000000000..8f418ac0e6 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_isInstantiable_error.phpt @@ -0,0 +1,22 @@ +--TEST-- +ReflectionObject::IsInstantiable() - invalid params +--FILE-- +IsInstantiable('X')); +var_dump($reflectionObject->IsInstantiable(0, null)); + +?> +--EXPECTF-- +Warning: Wrong parameter count for ReflectionClass::isInstantiable() in %s on line 10 +NULL + +Warning: Wrong parameter count for ReflectionClass::isInstantiable() in %s on line 11 +NULL diff --git a/ext/reflection/tests/reflectionObject_isInstantiable_variation.phpt b/ext/reflection/tests/reflectionObject_isInstantiable_variation.phpt new file mode 100644 index 0000000000..ac7199c096 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_isInstantiable_variation.phpt @@ -0,0 +1,78 @@ +--TEST-- +ReflectionObject::IsInstantiable() - variation - constructors +--FILE-- +getName(); + echo "Is $name instantiable? "; + var_dump($reflectionObject->IsInstantiable()); +} +?> +--EXPECTF-- +Is noCtor instantiable? bool(true) +Is publicCtorNew instantiable? bool(true) +Is protectedCtorNew instantiable? bool(false) +Is privateCtorNew instantiable? bool(false) +Is publicCtorOld instantiable? bool(true) +Is protectedCtorOld instantiable? bool(false) +Is privateCtorOld instantiable? bool(false) diff --git a/ext/reflection/tests/reflectionObject_isInternal_basic.phpt b/ext/reflection/tests/reflectionObject_isInternal_basic.phpt new file mode 100644 index 0000000000..066bca70ee --- /dev/null +++ b/ext/reflection/tests/reflectionObject_isInternal_basic.phpt @@ -0,0 +1,23 @@ +--TEST-- +ReflectionObject::isInternal() - basic function test +--FILE-- +isInternal(), $r2->isInternal(), $r3->isInternal(), + $r4->isInternal(), $r5->isInternal()); + +?> +--EXPECTF-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(false) diff --git a/ext/reflection/tests/reflectionObject_isInternal_error.phpt b/ext/reflection/tests/reflectionObject_isInternal_error.phpt new file mode 100644 index 0000000000..c22d748072 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_isInternal_error.phpt @@ -0,0 +1,15 @@ +--TEST-- +ReflectionObject::isInternal() - invalid params +--FILE-- +isInternal('X')); +var_dump($r1->isInternal('X', true)); +?> +--EXPECTF-- +Warning: Wrong parameter count for ReflectionClass::isInternal() in %s on line 4 +NULL + +Warning: Wrong parameter count for ReflectionClass::isInternal() in %s on line 5 +NULL diff --git a/ext/reflection/tests/reflectionObject_isSubclassOf_basic.phpt b/ext/reflection/tests/reflectionObject_isSubclassOf_basic.phpt new file mode 100644 index 0000000000..e89066a7ea --- /dev/null +++ b/ext/reflection/tests/reflectionObject_isSubclassOf_basic.phpt @@ -0,0 +1,116 @@ +--TEST-- +ReflectionObject::isSubclassOf() - basic function test +--FILE-- +isInstantiable()) { + $ros[$className] = new ReflectionObject(new $className); + } +} + +foreach ($ros as $childName => $child) { + foreach ($rcs as $parentName => $parent) { + echo "Is " . $childName . " a subclass of " . $parentName . "? \n"; + echo " - Using ReflectionClass object argument: "; + var_dump($child->isSubclassOf($parent)); + if ($parent->isInstantiable()) { + echo " - Using ReflectionObject object argument: "; + var_dump($child->isSubclassOf($ros[$parentName])); + } + echo " - Using string argument: "; + var_dump($child->isSubclassOf($parentName)); + } +} +?> +--EXPECTF-- +Is A a subclass of A? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is A a subclass of B? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is A a subclass of C? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is A a subclass of I? + - Using ReflectionClass object argument: bool(false) + - Using string argument: bool(false) +Is A a subclass of X? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is B a subclass of A? + - Using ReflectionClass object argument: bool(true) + - Using ReflectionObject object argument: bool(true) + - Using string argument: bool(true) +Is B a subclass of B? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is B a subclass of C? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is B a subclass of I? + - Using ReflectionClass object argument: bool(false) + - Using string argument: bool(false) +Is B a subclass of X? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is C a subclass of A? + - Using ReflectionClass object argument: bool(true) + - Using ReflectionObject object argument: bool(true) + - Using string argument: bool(true) +Is C a subclass of B? + - Using ReflectionClass object argument: bool(true) + - Using ReflectionObject object argument: bool(true) + - Using string argument: bool(true) +Is C a subclass of C? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is C a subclass of I? + - Using ReflectionClass object argument: bool(false) + - Using string argument: bool(false) +Is C a subclass of X? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is X a subclass of A? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is X a subclass of B? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is X a subclass of C? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) +Is X a subclass of I? + - Using ReflectionClass object argument: bool(true) + - Using string argument: bool(true) +Is X a subclass of X? + - Using ReflectionClass object argument: bool(false) + - Using ReflectionObject object argument: bool(false) + - Using string argument: bool(false) diff --git a/ext/reflection/tests/reflectionObject_isSubclassOf_error.phpt b/ext/reflection/tests/reflectionObject_isSubclassOf_error.phpt new file mode 100644 index 0000000000..9387b7dcb3 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_isSubclassOf_error.phpt @@ -0,0 +1,24 @@ +--TEST-- +ReflectionObject::isSubclassOf() - invalid params +--FILE-- +isSubclassOf()); +var_dump($ro->isSubclassOf('A',5)); +var_dump($ro->isSubclassOf('X')); + +?> +--EXPECTF-- +Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given in %s on line 5 +NULL + +Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given in %s on line 6 +NULL + +Fatal error: Uncaught exception 'ReflectionException' with message 'Class X does not exist' in %s:7 +Stack trace: +#0 %s(7): ReflectionClass->isSubclassOf('X') +#1 {main} + thrown in %s on line 7 diff --git a/ext/reflection/tests/reflectionObject_isUserDefined_basic.phpt b/ext/reflection/tests/reflectionObject_isUserDefined_basic.phpt new file mode 100644 index 0000000000..4cb08fcb67 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_isUserDefined_basic.phpt @@ -0,0 +1,23 @@ +--TEST-- +ReflectionObject::isUserDefined() - basic function test +--FILE-- +isUserDefined(), $r2->isUserDefined(), $r3->isUserDefined(), + $r4->isUserDefined(), $r5->isUserDefined()); + +?> +--EXPECTF-- +bool(false) +bool(false) +bool(false) +bool(false) +bool(true) diff --git a/ext/reflection/tests/reflectionObject_isUserDefined_error.phpt b/ext/reflection/tests/reflectionObject_isUserDefined_error.phpt new file mode 100644 index 0000000000..70533cf3d6 --- /dev/null +++ b/ext/reflection/tests/reflectionObject_isUserDefined_error.phpt @@ -0,0 +1,15 @@ +--TEST-- +ReflectionObject::isUserDefined() - invalid params +--FILE-- +isUserDefined('X')); +var_dump($r1->isUserDefined('X', true)); +?> +--EXPECTF-- +Warning: Wrong parameter count for ReflectionClass::isUserDefined() in %s on line 4 +NULL + +Warning: Wrong parameter count for ReflectionClass::isUserDefined() in %s on line 5 +NULL