dolibarr/htdocs/includes/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php

42 lines
871 B
PHP
Raw Normal View History

2020-09-08 02:59:49 +02:00
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\VarDumper\Tests\Test;
use PHPUnit\Framework\TestCase;
2020-09-08 02:59:49 +02:00
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
class VarDumperTestTraitTest extends TestCase
2020-09-08 02:59:49 +02:00
{
2021-10-19 21:04:19 +02:00
use VarDumperTestTrait;
2020-09-08 02:59:49 +02:00
2021-10-19 21:04:19 +02:00
public function testItComparesLargeData()
{
$howMany = 700;
$data = array_fill_keys(range(0, $howMany), array('a', 'b', 'c', 'd'));
2020-09-08 02:59:49 +02:00
2021-10-19 21:04:19 +02:00
$expected = sprintf("array:%d [\n", $howMany + 1);
for ($i = 0; $i <= $howMany; ++$i) {
$expected .= <<<EODUMP
2020-09-08 02:59:49 +02:00
$i => array:4 [
0 => "a"
1 => "b"
2 => "c"
3 => "d"
]\n
EODUMP;
2021-10-19 21:04:19 +02:00
}
$expected .= "]\n";
2020-09-08 02:59:49 +02:00
2021-10-19 21:04:19 +02:00
$this->assertDumpEquals($expected, $data);
}
2020-09-08 02:59:49 +02:00
}