]> granicus.if.org Git - php/commitdiff
Add test for bug #69084
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 3 Mar 2020 11:10:18 +0000 (12:10 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 3 Mar 2020 11:10:54 +0000 (12:10 +0100)
This is another bug fixed by the precending commit.

NEWS
Zend/tests/bug69084.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 5b47d27c89f941289ed31eebd8cb9902514c710e..055afa4896a14e16f9111e2567328448d14f1944 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ PHP                                                                        NEWS
     renamed). (Nikita)
   . Fixed bug #70839 (Converting optional argument to variadic forbidden by LSP
     checks). (Nikita)
+  . Fixed bug #69084 (Unclear error message when not implementing a renamed
+    abstract trait function). (Nikita)
 
 - CURL:
   . Bumped required libcurl version to 7.29.0. (cmb)
diff --git a/Zend/tests/bug69084.phpt b/Zend/tests/bug69084.phpt
new file mode 100644 (file)
index 0000000..2cefcc5
--- /dev/null
@@ -0,0 +1,29 @@
+--TEST--
+Bug #69084: Unclear error message when not implementing a renamed abstract trait function
+--FILE--
+<?php
+
+trait Foo {
+    abstract public function doStuff();
+
+    public function main() {
+        $this->doStuff();
+    }
+}
+
+class Bar {
+    use Foo {
+        Foo::doStuff as doOtherStuff;
+    }
+
+    public function doStuff() {
+        var_dump(__FUNCTION__);
+    }
+}
+
+$b = new Bar();
+$b->main();
+
+?>
+--EXPECTF--
+Fatal error: Class Bar contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Bar::doOtherStuff) in %s on line %d