Skip to content

Commit 7fea536

Browse files
committed
Add filter in VarDumperTestTrait
1 parent e9e19e7 commit 7fea536

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Symfony/Component/VarDumper/Test/VarDumperTestTrait.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
*/
2020
trait VarDumperTestTrait
2121
{
22-
public function assertDumpEquals($dump, $data, $message = '')
22+
public function assertDumpEquals($dump, $data, $message = '', $filter = 0)
2323
{
24-
$this->assertSame(rtrim($dump), $this->getDump($data), $message);
24+
$this->assertSame(rtrim($dump), $this->getDump($data, null, $filter), $message);
2525
}
2626

27-
public function assertDumpMatchesFormat($dump, $data, $message = '')
27+
public function assertDumpMatchesFormat($dump, $data, $message = '', $filter = 0)
2828
{
29-
$this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data), $message);
29+
$this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data, null, $filter), $message);
3030
}
3131

32-
protected function getDump($data, $key = null)
32+
protected function getDump($data, $key = null, $filter = 0)
3333
{
3434
$flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0;
3535
$flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0;
@@ -38,7 +38,7 @@ protected function getDump($data, $key = null)
3838
$cloner->setMaxItems(-1);
3939
$dumper = new CliDumper(null, null, $flags);
4040
$dumper->setColors(false);
41-
$data = $cloner->cloneVar($data)->withRefHandles(false);
41+
$data = $cloner->cloneVar($data, $filter)->withRefHandles(false);
4242
if (null !== $key && null === $data = $data->seek($key)) {
4343
return;
4444
}

0 commit comments

Comments
 (0)