@@ -17,26 +17,38 @@ Assert::exception(function () {
1717 Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'a ' ));
1818}, ReflectionException::class);
1919
20- Assert::same (NS \Foo:: DEFINED , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'b ' )));
20+ Assert::same (' abc ' , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'b ' )));
2121
22- Assert::same (NS \Foo:: DEFINED , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'c ' )));
22+ Assert::same (' abc ' , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'c ' )));
2323
24- Assert::same (NS \Foo:: DEFINED , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'd ' )));
24+ Assert::same (' abc ' , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'd ' )));
2525
26- Assert::same (NS \Bar::DEFINED , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'e ' )));
26+ Assert::same ('abc ' , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'e ' )));
27+
28+ Assert::same ('abc ' , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'f ' )));
29+
30+ Assert::same ('abc ' , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'g ' )));
31+
32+ Assert::same ('abc ' , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'h ' )));
33+
34+ Assert::exception (function () {
35+ Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'i ' ));
36+ }, ReflectionException::class, 'Unable to resolve constant self::UNDEFINED used as default value of $i in NS\Foo::method(). ' );
2737
2838Assert::exception (function () {
29- Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'f ' ));
30- }, ReflectionException::class, 'Unable to resolve constant self::UNDEFINED used as default value of $f in NS\Foo::method(). ' );
39+ Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'j ' ));
40+ }, ReflectionException::class, 'Unable to resolve constant NS \\Foo::UNDEFINED used as default value of $j in NS\Foo::method(). ' );
41+
42+ Assert::same (NS \Bar::DEFINED , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'k ' )));
3143
3244Assert::exception (function () {
33- Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'g ' ));
34- }, ReflectionException::class, 'Unable to resolve constant NS\Undefined::ANY used as default value of $g in NS\Foo::method(). ' );
45+ Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'l ' ));
46+ }, ReflectionException::class, 'Unable to resolve constant NS\Undefined::ANY used as default value of $l in NS\Foo::method(). ' );
3547
36- Assert::same (DEFINED , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'h ' )));
48+ Assert::same (DEFINED , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'm ' )));
3749
3850Assert::exception (function () {
39- Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'i ' ));
40- }, ReflectionException::class, 'Unable to resolve constant NS\UNDEFINED used as default value of $i in NS\Foo::method(). ' );
51+ Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'n ' ));
52+ }, ReflectionException::class, 'Unable to resolve constant NS\UNDEFINED used as default value of $n in NS\Foo::method(). ' );
4153
42- Assert::same (NS \NS_DEFINED , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'j ' )));
54+ Assert::same (NS \NS_DEFINED , Reflection::getParameterDefaultValue (new ReflectionParameter (['NS\Foo ' , 'method ' ], 'o ' )));
0 commit comments