summaryrefslogtreecommitdiff
path: root/ext/reflection
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2015-11-23 18:48:21 +0800
committerXinchen Hui <laruence@gmail.com>2015-11-23 18:48:21 +0800
commitb9845e5006adb7a41d6fdf5d36fc3b5c129f8946 (patch)
treedf3f0e046dc3a0910b80a2a8bb2c606c874a3108 /ext/reflection
parenta2b85ddecf666281717e50246950fd6d153bb0a8 (diff)
downloadphp-git-b9845e5006adb7a41d6fdf5d36fc3b5c129f8946.tar.gz
Add bug #70957 and #70958 releated test in refection
Diffstat (limited to 'ext/reflection')
-rw-r--r--ext/reflection/tests/ReflectionMethod_defaultArg.phpt44
1 files changed, 44 insertions, 0 deletions
diff --git a/ext/reflection/tests/ReflectionMethod_defaultArg.phpt b/ext/reflection/tests/ReflectionMethod_defaultArg.phpt
new file mode 100644
index 0000000000..1c04cade5f
--- /dev/null
+++ b/ext/reflection/tests/ReflectionMethod_defaultArg.phpt
@@ -0,0 +1,44 @@
+--TEST--
+ReflectionMethod and RECV_INIT (bug #70957 and #70958)
+--FILE--
+<?php
+Abstract class F {
+ private function bar($a = self::class) {}
+}
+
+Trait T
+{
+ private function bar($a = self::class) {}
+}
+
+
+class B {
+ use T;
+}
+
+echo new \ReflectionMethod('F', 'bar');
+echo new \ReflectionMethod('T', 'bar');
+echo new \ReflectionMethod('B', 'bar');
+?>
+--EXPECTF--
+Method [ <user> private method bar ] {
+ @@ %s
+
+ - Parameters [1] {
+ Parameter #0 [ <optional> $a = 'F' ]
+ }
+}
+Method [ <user> private method bar ] {
+ @@ %s
+
+ - Parameters [1] {
+ Parameter #0 [ <optional> $a = 'T' ]
+ }
+}
+Method [ <user> private method bar ] {
+ @@ %s
+
+ - Parameters [1] {
+ Parameter #0 [ <optional> $a = 'B' ]
+ }
+}