diff --git a/Dumper/CliDumper.php b/Dumper/CliDumper.php index c52ac4db..3e07e46d 100644 --- a/Dumper/CliDumper.php +++ b/Dumper/CliDumper.php @@ -184,6 +184,9 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) } if ('' === $str) { $this->line .= '""'; + if ($cut) { + $this->line .= '…'.$cut; + } $this->endValue($cursor); } else { $attr += [ diff --git a/Tests/Dumper/CliDumperTest.php b/Tests/Dumper/CliDumperTest.php index 84e91efd..25e9b103 100644 --- a/Tests/Dumper/CliDumperTest.php +++ b/Tests/Dumper/CliDumperTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\VarDumper\Tests\Dumper; use PHPUnit\Framework\TestCase; +use Symfony\Component\VarDumper\Caster\CutStub; use Symfony\Component\VarDumper\Cloner\VarCloner; use Symfony\Component\VarDumper\Dumper\AbstractDumper; use Symfony\Component\VarDumper\Dumper\CliDumper; @@ -37,6 +38,11 @@ public function testGet() ':stream' => function ($res, $a) { unset($a['uri'], $a['wrapper_data']); + return $a; + }, + 'Symfony\Component\VarDumper\Tests\Fixture\DumbFoo' => function ($foo, $a) { + $a['foo'] = new CutStub($a['foo']); + return $a; }, ]); @@ -76,7 +82,7 @@ public function testGet() %A options: [] } "obj" => Symfony\Component\VarDumper\Tests\Fixture\DumbFoo {#%d - +foo: "foo" + +foo: ""…3 +"bar": "bar" } "closure" => Closure(\$a, PDO &\$b = null) {#%d