VarDumperTestTraitTest.php 921 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  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 Symfony\Component\VarDumper\Tests\Test;
  11. use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
  12. class VarDumperTestTraitTest extends \PHPUnit_Framework_TestCase
  13. {
  14. use VarDumperTestTrait;
  15. public function testItComparesLargeData()
  16. {
  17. $howMany = 700;
  18. $data = array_fill_keys(range(0, $howMany), array('a', 'b', 'c', 'd'));
  19. $expected = sprintf("array:%d [\n", $howMany + 1);
  20. for ($i = 0; $i <= $howMany; ++$i) {
  21. $expected .= <<<EODUMP
  22. $i => array:4 [
  23. 0 => "a"
  24. 1 => "b"
  25. 2 => "c"
  26. 3 => "d"
  27. ]\n
  28. EODUMP;
  29. }
  30. $expected .= "]\n";
  31. $this->assertDumpEquals($expected, $data);
  32. }
  33. }