]> granicus.if.org Git - php/commitdiff
Add bug #70957 and #70958 releated test in refection
authorXinchen Hui <laruence@gmail.com>
Mon, 23 Nov 2015 10:48:21 +0000 (18:48 +0800)
committerXinchen Hui <laruence@gmail.com>
Mon, 23 Nov 2015 10:48:21 +0000 (18:48 +0800)
ext/reflection/tests/ReflectionMethod_defaultArg.phpt [new file with mode: 0644]

diff --git a/ext/reflection/tests/ReflectionMethod_defaultArg.phpt b/ext/reflection/tests/ReflectionMethod_defaultArg.phpt
new file mode 100644 (file)
index 0000000..1c04cad
--- /dev/null
@@ -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' ]
+  }
+}