Skip to content

Commit ff9321e

Browse files
committed
IHF: get_dump helper fully covered.
1 parent 36d1a6d commit ff9321e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/dump/GetDumpTest.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,37 @@ public function it_correctly_dumps_array()
5959

6060
$this->assertEquals($expected, get_dump($array));
6161
}
62+
63+
/** @test */
64+
public function it_correctly_dumps_array_with_very_long_strings()
65+
{
66+
$dump = get_dump([str_repeat('x', 3000)]);
67+
$this->assertNotContains('', $dump);
68+
$this->assertNotContains('...', $dump);
69+
}
70+
71+
/** @test */
72+
public function it_correctly_dumps_array_with_huge_amount_of_items()
73+
{
74+
$array = range(1, 3);
75+
$subArray = range(1, 3000);
76+
$array = array_map(function () use ($subArray) {
77+
return $subArray;
78+
}, $array);
79+
80+
$dump = get_dump($array);
81+
$this->assertNotContains('', $dump);
82+
$this->assertNotContains('...', $dump);
83+
}
84+
85+
/** @test */
86+
public function it_correctly_dumps_array_with_depth_50()
87+
{
88+
$key = trim(str_repeat('foo.', 50), '.');
89+
$array = array_add([], $key, 'bar');
90+
91+
$dump = get_dump($array);
92+
$this->assertNotContains('', $dump);
93+
$this->assertNotContains('...', $dump);
94+
}
6295
}

0 commit comments

Comments
 (0)