Skip to content

Commit ef31134

Browse files
ptomuliksebastianbergmann
authored andcommitted
created test for #5567
1 parent d5d9dca commit ef31134

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

tests/end-to-end/regression/5567.phpt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--TEST--
2+
https://github.com/sebastianbergmann/phpunit/issues/5567
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$_SERVER['argv'][] = '--do-not-cache-result';
6+
$_SERVER['argv'][] = '--no-configuration';
7+
$_SERVER['argv'][] = __DIR__ . '/5567/Issue5567Test.php';
8+
9+
require_once __DIR__ . '/../../bootstrap.php';
10+
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
11+
--EXPECTF--
12+
PHPUnit %s by Sebastian Bergmann and contributors.
13+
14+
Runtime: %s
15+
16+
F 1 / 1 (100%)
17+
18+
Time: %s, Memory: %s MB
19+
20+
There was 1 failure:
21+
22+
1) PHPUnit\TestFixture\Issue5567\Issue5567Test::testAnythingThatFailsWithRecursiveArray
23+
Failed asserting that Array &0 [
24+
'self' => Array &1 [
25+
'self' => Array &1,
26+
],
27+
] is false.
28+
29+
%sIssue5567Test.php:%d
30+
31+
FAILURES!
32+
Tests: 1, Assertions: 1, Failures: 1.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace PHPUnit\TestFixture\Issue5567;
11+
12+
use PHPUnit\Framework\TestCase;
13+
14+
final class Issue5567Test extends TestCase
15+
{
16+
public function testAnythingThatFailsWithRecursiveArray(): void
17+
{
18+
$array = [];
19+
$array['self'] = &$array;
20+
21+
$this->assertFalse($array);
22+
}
23+
}

0 commit comments

Comments
 (0)