diff --git a/tests/end-to-end/regression/5567.phpt b/tests/end-to-end/regression/5567.phpt new file mode 100644 index 00000000000..abcd46020ff --- /dev/null +++ b/tests/end-to-end/regression/5567.phpt @@ -0,0 +1,32 @@ +--TEST-- +https://github.com/sebastianbergmann/phpunit/issues/5567 +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann and contributors. + +Runtime: %s + +F 1 / 1 (100%) + +Time: %s, Memory: %s MB + +There was 1 failure: + +1) PHPUnit\TestFixture\Issue5567\Issue5567Test::testAnythingThatFailsWithRecursiveArray +Failed asserting that Array &0 [ + 'self' => Array &1 [ + 'self' => Array &1, + ], +] is false. + +%sIssue5567Test.php:%d + +FAILURES! +Tests: 1, Assertions: 1, Failures: 1. diff --git a/tests/end-to-end/regression/5567/Issue5567Test.php b/tests/end-to-end/regression/5567/Issue5567Test.php new file mode 100644 index 00000000000..cbbcec219ad --- /dev/null +++ b/tests/end-to-end/regression/5567/Issue5567Test.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\TestFixture\Issue5567; + +use PHPUnit\Framework\TestCase; + +final class Issue5567Test extends TestCase +{ + public function testAnythingThatFailsWithRecursiveArray(): void + { + $array = []; + $array['self'] = &$array; + + $this->assertFalse($array); + } +}