diff --git a/tests/end-to-end/regression/5822.phpt b/tests/end-to-end/regression/5822.phpt new file mode 100644 index 00000000000..2440499ae14 --- /dev/null +++ b/tests/end-to-end/regression/5822.phpt @@ -0,0 +1,22 @@ +--TEST-- +https://github.com/sebastianbergmann/phpunit/pull/5592 +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann and contributors. + +Runtime: %s +Configuration: %s + +D 1 / 1 (100%) + +Time: %s, Memory: %s + +OK, but there were issues! +Tests: 1, Assertions: 1, Deprecations: 1. diff --git a/tests/end-to-end/regression/5822/phpunit.xml b/tests/end-to-end/regression/5822/phpunit.xml new file mode 100644 index 00000000000..867b70dc246 --- /dev/null +++ b/tests/end-to-end/regression/5822/phpunit.xml @@ -0,0 +1,15 @@ + + + + + tests + + + + + + src + + + diff --git a/tests/end-to-end/regression/5822/src/.gitignore b/tests/end-to-end/regression/5822/src/.gitignore new file mode 100644 index 00000000000..5e7d2734cfc --- /dev/null +++ b/tests/end-to-end/regression/5822/src/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/tests/end-to-end/regression/5822/tests/Issue5822Test.php b/tests/end-to-end/regression/5822/tests/Issue5822Test.php new file mode 100644 index 00000000000..2d275f31128 --- /dev/null +++ b/tests/end-to-end/regression/5822/tests/Issue5822Test.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\TestFixture\Issue5822; + +use PHPUnit\Framework\TestCase; + +class Issue5822Test extends TestCase +{ + public function testDebugBacktrace() + { + $this->callUserFuncExample(); + $this->assertTrue(true); + } + + private function callUserFuncExample(): void + { + call_user_func([$this, 'exampleCallback']); + } + + private function exampleCallback(): void + { + trigger_error('My Deprecation Error', \E_USER_DEPRECATED); + } +}