Skip to content

Commit 86e77eb

Browse files
feature #15175 [VarDumper] Ingore PHPUnit and Prophecy object when they are nested (lyrixx)
This PR was merged into the 2.8 branch. Discussion ---------- [VarDumper] Ingore PHPUnit and Prophecy object when they are nested | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - The purpose of this PR is to ignore nested PHPUnit/Prophecy object when `dump`ing. Reproducer: ```php $a = $this->getMock('Datetime'); $b = $this->prophesize('Datetime')->reveal(); $std = new \stdClass; $std->my = 'property'; $std->a = $a; $std->b = $b; die(dump($a, $b, $std)); ``` => ``` {#86 +"my": "property" +"a": Mock_Datetime_8ba7f351 {#22 …5} +"b": Double\DateTime\P1 {#90 …1} } ``` Commits ------- 2bea373 [VarDumper] Ingore PHPUnit and Prophecy object when they are nested
2 parents 60e1eed + 2bea373 commit 86e77eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ abstract class AbstractCloner implements ClonerInterface
6969
'Symfony\Component\DependencyInjection\ContainerInterface' => 'Symfony\Component\VarDumper\Caster\StubCaster::cutInternals',
7070
'Symfony\Component\VarDumper\Exception\ThrowingCasterException' => 'Symfony\Component\VarDumper\Caster\ExceptionCaster::castThrowingCasterException',
7171

72+
'PHPUnit_Framework_MockObject_MockObject' => 'Symfony\Component\VarDumper\Caster\StubCaster::cutInternals',
73+
'Prophecy\Prophecy\ProphecySubjectInterface' => 'Symfony\Component\VarDumper\Caster\StubCaster::cutInternals',
74+
'Mockery\MockInterface' => 'Symfony\Component\VarDumper\Caster\StubCaster::cutInternals',
75+
7276
'PDO' => 'Symfony\Component\VarDumper\Caster\PdoCaster::castPdo',
7377
'PDOStatement' => 'Symfony\Component\VarDumper\Caster\PdoCaster::castPdoStatement',
7478

0 commit comments

Comments
 (0)