Skip to content

Commit

Permalink
IHF: get_dump helper fully covered.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-ivanov committed Sep 15, 2016
1 parent 36d1a6d commit ff9321e
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/dump/GetDumpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,37 @@ public function it_correctly_dumps_array()

$this->assertEquals($expected, get_dump($array));
}

/** @test */
public function it_correctly_dumps_array_with_very_long_strings()
{
$dump = get_dump([str_repeat('x', 3000)]);
$this->assertNotContains('', $dump);
$this->assertNotContains('...', $dump);
}

/** @test */
public function it_correctly_dumps_array_with_huge_amount_of_items()
{
$array = range(1, 3);
$subArray = range(1, 3000);
$array = array_map(function () use ($subArray) {
return $subArray;
}, $array);

$dump = get_dump($array);
$this->assertNotContains('', $dump);
$this->assertNotContains('...', $dump);
}

/** @test */
public function it_correctly_dumps_array_with_depth_50()
{
$key = trim(str_repeat('foo.', 50), '.');
$array = array_add([], $key, 'bar');

$dump = get_dump($array);
$this->assertNotContains('', $dump);
$this->assertNotContains('...', $dump);
}
}

0 comments on commit ff9321e

Please sign in to comment.