diff options
Diffstat (limited to 'ext/reflection/tests')
31 files changed, 141 insertions, 130 deletions
diff --git a/ext/reflection/tests/ReflectionClassConstant_basic1.phpt b/ext/reflection/tests/ReflectionClassConstant_basic1.phpt index 548d64e1bf..78510d0b35 100644 --- a/ext/reflection/tests/ReflectionClassConstant_basic1.phpt +++ b/ext/reflection/tests/ReflectionClassConstant_basic1.phpt @@ -73,7 +73,7 @@ bool(false) isProtected(): bool(false) getModifiers(): -int(256) +int(1) getDeclaringClass(): object(ReflectionClass)#3 (1) { ["name"]=> @@ -107,7 +107,7 @@ bool(false) isProtected(): bool(true) getModifiers(): -int(512) +int(2) getDeclaringClass(): object(ReflectionClass)#3 (1) { ["name"]=> @@ -141,7 +141,7 @@ bool(true) isProtected(): bool(false) getModifiers(): -int(1024) +int(4) getDeclaringClass(): object(ReflectionClass)#3 (1) { ["name"]=> @@ -175,7 +175,7 @@ bool(true) isProtected(): bool(false) getModifiers(): -int(1024) +int(4) getDeclaringClass(): object(ReflectionClass)#3 (1) { ["name"]=> diff --git a/ext/reflection/tests/ReflectionClass_FileInfo_basic.phpt b/ext/reflection/tests/ReflectionClass_FileInfo_basic.phpt index 28769da707..05565efae3 100644 --- a/ext/reflection/tests/ReflectionClass_FileInfo_basic.phpt +++ b/ext/reflection/tests/ReflectionClass_FileInfo_basic.phpt @@ -14,7 +14,7 @@ var_dump($rc->getStartLine()); //Get the line number at the end of the definition of class C var_dump($rc->getEndLine()); -//Same tests as above but stdclass is internal - so all results should be false. +//Same tests as above but stdclass is internal - so all results should be false. $rc = new ReflectionClass("stdClass"); var_dump($rc->getFileName()); var_dump($rc->getStartLine()); diff --git a/ext/reflection/tests/ReflectionClass_getDocComment_001.phpt b/ext/reflection/tests/ReflectionClass_getDocComment_001.phpt index 31e0e8e58b..8edc6a93a6 100644 --- a/ext/reflection/tests/ReflectionClass_getDocComment_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getDocComment_001.phpt @@ -11,8 +11,8 @@ opcache.save_comments=1 My -Doc - * Comment +Doc + * Comment for A * */ @@ -63,8 +63,8 @@ string(%d) "/** My -Doc - * Comment +Doc + * Comment for A * */" diff --git a/ext/reflection/tests/ReflectionClass_getInterfaces_002.phpt b/ext/reflection/tests/ReflectionClass_getInterfaces_002.phpt index 8fa08869da..998bd4bea6 100644 --- a/ext/reflection/tests/ReflectionClass_getInterfaces_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getInterfaces_002.phpt @@ -25,24 +25,24 @@ Array [name] => I6 ) - [I2] => ReflectionClass Object + [I4] => ReflectionClass Object ( - [name] => I2 + [name] => I4 ) - [I1] => ReflectionClass Object + [I3] => ReflectionClass Object ( - [name] => I1 + [name] => I3 ) - [I4] => ReflectionClass Object + [I2] => ReflectionClass Object ( - [name] => I4 + [name] => I2 ) - [I3] => ReflectionClass Object + [I1] => ReflectionClass Object ( - [name] => I3 + [name] => I1 ) [I5] => ReflectionClass Object @@ -50,4 +50,4 @@ Array [name] => I5 ) -)
\ No newline at end of file +) diff --git a/ext/reflection/tests/ReflectionClass_getMethods_003.phpt b/ext/reflection/tests/ReflectionClass_getMethods_003.phpt index 885bd908f1..b08fcaa4d4 100644 --- a/ext/reflection/tests/ReflectionClass_getMethods_003.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethods_003.phpt @@ -17,9 +17,9 @@ class C { } $rc = new ReflectionClass("C"); -$StaticFlag = 0x01; -$pubFlag = 0x100; -$privFlag = 0x400; +$StaticFlag = ReflectionMethod::IS_STATIC; +$pubFlag = ReflectionMethod::IS_PUBLIC; +$privFlag = ReflectionMethod::IS_PRIVATE; echo "No methods:"; var_dump($rc->getMethods(0)); diff --git a/ext/reflection/tests/ReflectionClass_getModifiers_basic.phpt b/ext/reflection/tests/ReflectionClass_getModifiers_basic.phpt index f77bbacda7..ffe8876133 100644 --- a/ext/reflection/tests/ReflectionClass_getModifiers_basic.phpt +++ b/ext/reflection/tests/ReflectionClass_getModifiers_basic.phpt @@ -29,8 +29,8 @@ dump_modifiers('g'); ?> --EXPECT-- int(0) +int(64) int(32) -int(4) int(0) int(0) int(0) diff --git a/ext/reflection/tests/ReflectionClass_getProperties_003.phpt b/ext/reflection/tests/ReflectionClass_getProperties_003.phpt index ac16a68349..229e828056 100644 --- a/ext/reflection/tests/ReflectionClass_getProperties_003.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperties_003.phpt @@ -17,9 +17,9 @@ class C { } $rc = new ReflectionClass("C"); -$StaticFlag = 0x01; -$pubFlag = 0x100; -$privFlag = 0x400; +$StaticFlag = ReflectionProperty::IS_STATIC; +$pubFlag = ReflectionProperty::IS_PUBLIC; +$privFlag = ReflectionProperty::IS_PRIVATE; echo "No properties:"; var_dump($rc->getProperties(0)); diff --git a/ext/reflection/tests/ReflectionClass_hasMethod_001.phpt b/ext/reflection/tests/ReflectionClass_hasMethod_001.phpt index b9eb013522..79009d3bdb 100644 --- a/ext/reflection/tests/ReflectionClass_hasMethod_001.phpt +++ b/ext/reflection/tests/ReflectionClass_hasMethod_001.phpt @@ -7,14 +7,14 @@ Steve Seear <stevseea@php.net> <?php class pubf { public function f() {} - static public function s() {} + static public function s() {} } class subpubf extends pubf { } class protf { protected function f() {} - static protected function s() {} + static protected function s() {} } class subprotf extends protf { } @@ -26,7 +26,7 @@ class privf { class subprivf extends privf { } -$classes = array("pubf", "subpubf", "protf", "subprotf", +$classes = array("pubf", "subpubf", "protf", "subprotf", "privf", "subprivf"); foreach($classes as $class) { echo "Reflecting on class $class: \n"; diff --git a/ext/reflection/tests/ReflectionClass_isInternal_basic.phpt b/ext/reflection/tests/ReflectionClass_isInternal_basic.phpt index 9c656a38b6..7d7e61335d 100644 --- a/ext/reflection/tests/ReflectionClass_isInternal_basic.phpt +++ b/ext/reflection/tests/ReflectionClass_isInternal_basic.phpt @@ -11,7 +11,7 @@ $r3 = new ReflectionClass("ReflectionProperty"); $r4 = new ReflectionClass("Exception"); $r5 = new ReflectionClass("C"); -var_dump($r1->isInternal(), $r2->isInternal(), $r3->isInternal(), +var_dump($r1->isInternal(), $r2->isInternal(), $r3->isInternal(), $r4->isInternal(), $r5->isInternal()); ?> --EXPECT-- diff --git a/ext/reflection/tests/ReflectionClass_isUserDefined_basic.phpt b/ext/reflection/tests/ReflectionClass_isUserDefined_basic.phpt index e9537c1e8a..5babb546ae 100644 --- a/ext/reflection/tests/ReflectionClass_isUserDefined_basic.phpt +++ b/ext/reflection/tests/ReflectionClass_isUserDefined_basic.phpt @@ -11,7 +11,7 @@ $r3 = new ReflectionClass("ReflectionProperty"); $r4 = new ReflectionClass("Exception"); $r5 = new ReflectionClass("C"); -var_dump($r1->isUserDefined(), $r2->isUserDefined(), $r3->isUserDefined(), +var_dump($r1->isUserDefined(), $r2->isUserDefined(), $r3->isUserDefined(), $r4->isUserDefined(), $r5->isUserDefined()); ?> --EXPECT-- diff --git a/ext/reflection/tests/ReflectionClass_modifiers_001.phpt b/ext/reflection/tests/ReflectionClass_modifiers_001.phpt index d82519e4f4..1370228f04 100644 --- a/ext/reflection/tests/ReflectionClass_modifiers_001.phpt +++ b/ext/reflection/tests/ReflectionClass_modifiers_001.phpt @@ -25,7 +25,7 @@ foreach ($classes as $class) { bool(false) bool(false) bool(true) -int(32) +int(64) bool(false) bool(false) bool(false) @@ -37,7 +37,7 @@ int(0) bool(true) bool(false) bool(false) -int(4) +int(32) bool(false) bool(true) bool(false) diff --git a/ext/reflection/tests/ReflectionClass_toString_001.phpt b/ext/reflection/tests/ReflectionClass_toString_001.phpt index cafdd2e37c..e97af14110 100644 --- a/ext/reflection/tests/ReflectionClass_toString_001.phpt +++ b/ext/reflection/tests/ReflectionClass_toString_001.phpt @@ -13,8 +13,8 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector ] { - Constants [3] { Constant [ public int IS_IMPLICIT_ABSTRACT ] { 16 } - Constant [ public int IS_EXPLICIT_ABSTRACT ] { 32 } - Constant [ public int IS_FINAL ] { 4 } + Constant [ public int IS_EXPLICIT_ABSTRACT ] { 64 } + Constant [ public int IS_FINAL ] { 32 } } - Static properties [0] { diff --git a/ext/reflection/tests/ReflectionFunction_getClosure_basic.phpt b/ext/reflection/tests/ReflectionFunction_getClosure_basic.phpt index 4c76959aec..2b7927e7ac 100644 --- a/ext/reflection/tests/ReflectionFunction_getClosure_basic.phpt +++ b/ext/reflection/tests/ReflectionFunction_getClosure_basic.phpt @@ -1,9 +1,9 @@ --TEST-- -Test ReflectionFunction::getClosure() function : basic functionality +Test ReflectionFunction::getClosure() function : basic functionality --FILE-- <?php /* Prototype : public mixed ReflectionFunction::getClosure() - * Description: Returns a dynamically created closure for the function + * Description: Returns a dynamically created closure for the function * Source code: ext/reflection/php_reflection.c * Alias to functions: */ diff --git a/ext/reflection/tests/ReflectionMethod_getClosure_basic.phpt b/ext/reflection/tests/ReflectionMethod_getClosure_basic.phpt index bf1bcf3603..f0a414d56b 100644 --- a/ext/reflection/tests/ReflectionMethod_getClosure_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_getClosure_basic.phpt @@ -1,9 +1,9 @@ --TEST-- -Test ReflectionMethod::getClosure() function : basic functionality +Test ReflectionMethod::getClosure() function : basic functionality --FILE-- <?php /* Prototype : public mixed ReflectionFunction::getClosure() - * Description: Returns a dynamically created closure for the method + * Description: Returns a dynamically created closure for the method * Source code: ext/reflection/php_reflection.c * Alias to functions: */ diff --git a/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt b/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt index 2544b0e7ec..e011f259b2 100644 --- a/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt @@ -44,7 +44,7 @@ class B extends A { private function privf() {} - /** My Doc Comment for B::protStatf + /** My Doc Comment for B::protStatf @@ -100,7 +100,7 @@ string(%d) "/** * ---> Doc comment for B::protStatf(): -string(%d) "/** My Doc Comment for B::protStatf +string(%d) "/** My Doc Comment for B::protStatf diff --git a/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt b/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt index 55aea10763..d1a19c7116 100644 --- a/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt @@ -87,151 +87,151 @@ printf("0x%08x\n", $a->getModifiers()); ?> --EXPECTF-- Modifiers for method TestClass::foo(): -0x00000100 +0x00000001 Modifiers for method TestClass::stat(): -0x00000101 +0x00000011 Modifiers for method TestClass::priv(): -0x00000400 +0x00000004 Modifiers for method TestClass::prot(): -0x00000200 +0x00000002 Modifiers for method TestClass::fin(): -0x00000104 +0x00000021 Modifiers for method TestClass::__destruct(): -0x00000100 +0x00000001 Modifiers for method TestClass::__call(): -0x00000100 +0x00000001 Modifiers for method TestClass::__clone(): -0x00000100 +0x00000001 Modifiers for method TestClass::__get(): -0x00000100 +0x00000001 Modifiers for method TestClass::__set(): -0x00000100 +0x00000001 Modifiers for method TestClass::__unset(): -0x00000100 +0x00000001 Modifiers for method TestClass::__isset(): -0x00000100 +0x00000001 Modifiers for method TestClass::__tostring(): -0x00000100 +0x00000001 Modifiers for method TestClass::__sleep(): -0x00000100 +0x00000001 Modifiers for method TestClass::__wakeup(): -0x00000100 +0x00000001 Modifiers for method TestClass::__set_state(): -0x00000100 +0x00000001 Modifiers for method TestClass::__autoload(): -0x00000100 +0x00000001 Modifiers for method TestClass::foo(): -0x00000100 +0x00000001 Modifiers for method TestClass::stat(): -0x00000101 +0x00000011 Modifiers for method TestClass::priv(): -0x00000400 +0x00000004 Modifiers for method TestClass::prot(): -0x00000200 +0x00000002 Modifiers for method TestClass::fin(): -0x00000104 +0x00000021 Modifiers for method TestClass::__destruct(): -0x00000100 +0x00000001 Modifiers for method TestClass::__call(): -0x00000100 +0x00000001 Modifiers for method TestClass::__clone(): -0x00000100 +0x00000001 Modifiers for method TestClass::__get(): -0x00000100 +0x00000001 Modifiers for method TestClass::__set(): -0x00000100 +0x00000001 Modifiers for method TestClass::__unset(): -0x00000100 +0x00000001 Modifiers for method TestClass::__isset(): -0x00000100 +0x00000001 Modifiers for method TestClass::__tostring(): -0x00000100 +0x00000001 Modifiers for method TestClass::__sleep(): -0x00000100 +0x00000001 Modifiers for method TestClass::__wakeup(): -0x00000100 +0x00000001 Modifiers for method TestClass::__set_state(): -0x00000100 +0x00000001 Modifiers for method TestClass::__autoload(): -0x00000100 +0x00000001 Modifiers for method TestInterface::int(): -0x00000102 +0x00000041 Modifiers for method TestInterface::__clone(): -0x00000102 +0x00000041 Modifiers for method AbstractClass::foo(): -0x00000102 +0x00000041 Wrong number of params: @@ -239,4 +239,4 @@ Wrong number of params: Warning: ReflectionMethod::getModifiers() expects exactly 0 parameters, 1 given in %s on line %d ReflectionMethod::getModifiers() modifiers: -0x00000100 +0x00000001 diff --git a/ext/reflection/tests/ReflectionObject_FileInfo_error.phpt b/ext/reflection/tests/ReflectionObject_FileInfo_error.phpt index 70ad24297d..623ba7b480 100644 --- a/ext/reflection/tests/ReflectionObject_FileInfo_error.phpt +++ b/ext/reflection/tests/ReflectionObject_FileInfo_error.phpt @@ -1,5 +1,5 @@ --TEST-- -ReflectionObject::getFileName(), ReflectionObject::getStartLine(), ReflectionObject::getEndLine() -invalid aparams +ReflectionObject::getFileName(), ReflectionObject::getStartLine(), ReflectionObject::getEndLine() -invalid aparams --FILE-- <?php Class C { } diff --git a/ext/reflection/tests/ReflectionObject_export_basic3.phpt b/ext/reflection/tests/ReflectionObject_export_basic3.phpt index dfd3f2e803..7c1da34c93 100644 --- a/ext/reflection/tests/ReflectionObject_export_basic3.phpt +++ b/ext/reflection/tests/ReflectionObject_export_basic3.phpt @@ -1,5 +1,5 @@ --TEST-- -ReflectionObject::export() - ensure dynamic property with same name as inherited private property is shown. +ReflectionObject::export() - ensure dynamic property with same name as inherited private property is shown. --FILE-- <?php class C { diff --git a/ext/reflection/tests/ReflectionObject_getConstants_basic.phpt b/ext/reflection/tests/ReflectionObject_getConstants_basic.phpt index 0ecbde7991..8a56c9f64e 100644 --- a/ext/reflection/tests/ReflectionObject_getConstants_basic.phpt +++ b/ext/reflection/tests/ReflectionObject_getConstants_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -ReflectionObject::getConstants() - basic function test +ReflectionObject::getConstants() - basic function test --FILE-- <?php class C { diff --git a/ext/reflection/tests/ReflectionObject_isInstantiable_variation.phpt b/ext/reflection/tests/ReflectionObject_isInstantiable_variation.phpt index 675bbdde8d..167b6b0ff3 100644 --- a/ext/reflection/tests/ReflectionObject_isInstantiable_variation.phpt +++ b/ext/reflection/tests/ReflectionObject_isInstantiable_variation.phpt @@ -57,7 +57,7 @@ $reflectionObjects = array( publicCtorNew::reflectionObjectFactory(), protectedCtorNew::reflectionObjectFactory(), privateCtorNew::reflectionObjectFactory(), - publicCtorOld::reflectionObjectFactory(), + publicCtorOld::reflectionObjectFactory(), protectedCtorOld::reflectionObjectFactory(), privateCtorOld::reflectionObjectFactory() ); diff --git a/ext/reflection/tests/ReflectionObject_isInternal_basic.phpt b/ext/reflection/tests/ReflectionObject_isInternal_basic.phpt index 234b8eb27e..60a95dc886 100644 --- a/ext/reflection/tests/ReflectionObject_isInternal_basic.phpt +++ b/ext/reflection/tests/ReflectionObject_isInternal_basic.phpt @@ -11,7 +11,7 @@ $r3 = new ReflectionObject(new ReflectionProperty('Exception', 'message')); $r4 = new ReflectionObject(new Exception); $r5 = new ReflectionObject(new C); -var_dump($r1->isInternal(), $r2->isInternal(), $r3->isInternal(), +var_dump($r1->isInternal(), $r2->isInternal(), $r3->isInternal(), $r4->isInternal(), $r5->isInternal()); ?> diff --git a/ext/reflection/tests/ReflectionObject_isUserDefined_basic.phpt b/ext/reflection/tests/ReflectionObject_isUserDefined_basic.phpt index 1a9dea3aba..390df504db 100644 --- a/ext/reflection/tests/ReflectionObject_isUserDefined_basic.phpt +++ b/ext/reflection/tests/ReflectionObject_isUserDefined_basic.phpt @@ -11,7 +11,7 @@ $r3 = new ReflectionObject(new ReflectionProperty('Exception', 'message')); $r4 = new ReflectionObject(new Exception); $r5 = new ReflectionObject(new C); -var_dump($r1->isUserDefined(), $r2->isUserDefined(), $r3->isUserDefined(), +var_dump($r1->isUserDefined(), $r2->isUserDefined(), $r3->isUserDefined(), $r4->isUserDefined(), $r5->isUserDefined()); ?> diff --git a/ext/reflection/tests/ReflectionProperty_basic2.phpt b/ext/reflection/tests/ReflectionProperty_basic2.phpt index 0491073ace..09495f744b 100644 --- a/ext/reflection/tests/ReflectionProperty_basic2.phpt +++ b/ext/reflection/tests/ReflectionProperty_basic2.phpt @@ -43,7 +43,7 @@ Reflecting on property TestClass::pub isDefault(): bool(true) getModifiers(): -int(256) +int(1) getDeclaringClass(): object(ReflectionClass)#%d (1) { ["name"]=> @@ -59,7 +59,7 @@ Reflecting on property TestClass::stat isDefault(): bool(true) getModifiers(): -int(257) +int(17) getDeclaringClass(): object(ReflectionClass)#%d (1) { ["name"]=> @@ -75,7 +75,7 @@ Reflecting on property TestClass::prot isDefault(): bool(true) getModifiers(): -int(512) +int(2) getDeclaringClass(): object(ReflectionClass)#%d (1) { ["name"]=> @@ -93,7 +93,7 @@ Reflecting on property TestClass::priv isDefault(): bool(true) getModifiers(): -int(1024) +int(4) getDeclaringClass(): object(ReflectionClass)#%d (1) { ["name"]=> diff --git a/ext/reflection/tests/ReflectionProperty_getModifiers.001.phpt b/ext/reflection/tests/ReflectionProperty_getModifiers.001.phpt index 6d7ddbe834..e2ff294261 100644 --- a/ext/reflection/tests/ReflectionProperty_getModifiers.001.phpt +++ b/ext/reflection/tests/ReflectionProperty_getModifiers.001.phpt @@ -23,7 +23,7 @@ class TestClass public $pub; static public $stat = "static property"; /** - * This property has a comment. + * This property has a comment. */ protected $prot = 4; private $priv = "keepOut"; @@ -40,27 +40,27 @@ reflectProperty("TestClass", "priv"); Reflecting on property TestClass::pub getModifiers(): -int(256) +int(1) ********************************** ********************************** Reflecting on property TestClass::stat getModifiers(): -int(257) +int(17) ********************************** ********************************** Reflecting on property TestClass::prot getModifiers(): -int(512) +int(2) ********************************** ********************************** Reflecting on property TestClass::priv getModifiers(): -int(1024) +int(4) ********************************** diff --git a/ext/reflection/tests/ReflectionProperty_getModifiers_basic.phpt b/ext/reflection/tests/ReflectionProperty_getModifiers_basic.phpt index 4c99444e30..6856569d3e 100644 --- a/ext/reflection/tests/ReflectionProperty_getModifiers_basic.phpt +++ b/ext/reflection/tests/ReflectionProperty_getModifiers_basic.phpt @@ -32,15 +32,15 @@ for ($i = 1;$i <= 6;$i++) { ?> --EXPECT-- -C::a1: int(256) -D::a1: int(256) -C::a2: int(512) -D::a2: int(512) -C::a3: int(1024) -D::a3: int(1024) -C::a4: int(257) -D::a4: int(257) -C::a5: int(513) -D::a5: int(513) -C::a6: int(1025) -D::a6: int(1025) +C::a1: int(1) +D::a1: int(1) +C::a2: int(2) +D::a2: int(2) +C::a3: int(4) +D::a3: int(4) +C::a4: int(17) +D::a4: int(17) +C::a5: int(18) +D::a5: int(18) +C::a6: int(20) +D::a6: int(20) diff --git a/ext/reflection/tests/bug42976.phpt b/ext/reflection/tests/bug42976.phpt index 0b147aa811..7edf06474c 100644 --- a/ext/reflection/tests/bug42976.phpt +++ b/ext/reflection/tests/bug42976.phpt @@ -18,7 +18,7 @@ $x = "x.original"; $rc->newInstance($x); // causes crash var_dump($x); $x = "x.original"; -$rc->newInstanceArgs(array($x)); // causes crash +$rc->newInstanceArgs(array($x)); // causes crash var_dump($x); echo "Done\n"; diff --git a/ext/reflection/tests/bug49719.phpt b/ext/reflection/tests/bug49719.phpt index f55334c951..6211b6b543 100644 --- a/ext/reflection/tests/bug49719.phpt +++ b/ext/reflection/tests/bug49719.phpt @@ -36,7 +36,7 @@ $prop->setAccessible(true); var_dump($prop->getValue(new b2)); ?> ---EXPECTF-- +--EXPECT-- bool(false) bool(false) bool(false) diff --git a/ext/reflection/tests/bug61388.phpt b/ext/reflection/tests/bug61388.phpt index 3d6dc83fa0..b9fe6bfaaa 100644 --- a/ext/reflection/tests/bug61388.phpt +++ b/ext/reflection/tests/bug61388.phpt @@ -14,12 +14,6 @@ print_r($reflObj->getProperties(ReflectionProperty::IS_PUBLIC)); --EXPECT-- Array ( - [0] => ReflectionProperty Object - ( - [name] => test - [class] => ArrayObject - ) - ) Array ( diff --git a/ext/reflection/tests/bug66430.phpt b/ext/reflection/tests/bug66430.phpt index 921e2c99d8..6e35a0389e 100644 --- a/ext/reflection/tests/bug66430.phpt +++ b/ext/reflection/tests/bug66430.phpt @@ -5,7 +5,7 @@ Bug #66430: ReflectionFunction::invoke does not invoke closure with object scope class Alpha { public $message = "Valid representation"; - + public function bravo() { return $this->message; } diff --git a/ext/reflection/tests/bug76737.phpt b/ext/reflection/tests/bug76737.phpt new file mode 100644 index 0000000000..716b40e76a --- /dev/null +++ b/ext/reflection/tests/bug76737.phpt @@ -0,0 +1,33 @@ +--TEST-- +Bug #76737: Unserialized reflection objects are broken, they shouldn't be serializable +--FILE-- +<?php + +try { + $r = new ReflectionClass('stdClass'); + var_dump(serialize($r)); +} catch (Exception $e) { + echo $e->getMessage(), "\n"; +} +try { + $s = 'C:15:"ReflectionClass":0:{}'; + var_dump(unserialize($s)); +} catch (Exception $e) { + echo $e->getMessage(), "\n"; +} +try { + $s = 'O:15:"ReflectionClass":0:{}'; + var_dump(unserialize($s)); +} catch (Exception $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECTF-- +Serialization of 'ReflectionClass' is not allowed +Unserialization of 'ReflectionClass' is not allowed + +Warning: Erroneous data format for unserializing 'ReflectionClass' in %s on line %d + +Notice: unserialize(): Error at offset 26 of 27 bytes in %s on line %d +bool(false) diff --git a/ext/reflection/tests/exception.inc b/ext/reflection/tests/exception.inc deleted file mode 100644 index da3fceaac7..0000000000 --- a/ext/reflection/tests/exception.inc +++ /dev/null @@ -1,16 +0,0 @@ -<?php -class ReflectionExceptionEx extends ReflectionException { - function MyException($_errno, $_errmsg) { - $this->errno = $_errno; - $this->errmsg = $_errmsg; - } - - function getErrno() { - return $this->errno; - } - - function getErrmsg() { - return $this->errmsg; - } -} -?> |
