com php-src: Add bug #70957 and #70958 releated test in refection: ext/reflection/tests/ReflectionMethod_defaultArg.phpt
| From: | Xinchen Hui | Date: | Mon, 23 Nov 2015 10:48:21 +0000 |
| Subject: | com php-src: Add bug #70957 and #70958 releated test in refection: ext/reflection/tests/ReflectionMethod_defaultArg.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89969@lists.php.net to get a copy of this message | ||
Commit: b9845e5006adb7a41d6fdf5d36fc3b5c129f8946
Author: Xinchen Hui <laruence@gmail.com> Mon, 23 Nov 2015 18:48:21 +0800
Parents: a2b85ddecf666281717e50246950fd6d153bb0a8
Branches: PHP-5.6 PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b9845e5006adb7a41d6fdf5d36fc3b5c129f8946
Log:
Add bug #70957 and #70958 releated test in refection
Bugs:
https://bugs.php.net/70957
https://bugs.php.net/70958
Changed paths:
A ext/reflection/tests/ReflectionMethod_defaultArg.phpt
Diff:
diff --git a/ext/reflection/tests/ReflectionMethod_defaultArg.phpt
b/ext/reflection/tests/ReflectionMethod_defaultArg.phpt
new file mode 100644
index 0000000..1c04cad
--- /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' ]
+ }
+}