Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66ead2e

Browse files
minor #23476 [VarDumper] Test ReflectionCaster excluding verbosity (maidmaid)
This PR was merged into the 3.4 branch. Discussion ---------- [VarDumper] Test ReflectionCaster excluding verbosity | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | / | License | MIT | Doc PR | / Cover better ``ReflectionCaster`` in tests thanks to ``EXCLUDE_*`` filter which was added in #22588. Commits ------- e535089 Add exculde verbosity test
2 parents f9d73b9 + e535089 commit 66ead2e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\VarDumper\Tests\Caster;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\VarDumper\Caster\Caster;
1516
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
1617
use Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo;
1718
use Symfony\Component\VarDumper\Tests\Fixtures\NotLoadableClass;
@@ -77,13 +78,27 @@ public function testClosureCaster()
7778
\$b: & 123
7879
}
7980
file: "%sReflectionCasterTest.php"
80-
line: "67 to 67"
81+
line: "68 to 68"
8182
}
8283
EOTXT
8384
, $var
8485
);
8586
}
8687

88+
public function testClosureCasterExcludingVerbosity()
89+
{
90+
$var = function () {};
91+
92+
$expectedDump = <<<EOTXT
93+
Closure {
94+
class: "Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest"
95+
this: Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest { …}
96+
}
97+
EOTXT;
98+
99+
$this->assertDumpEquals($expectedDump, $var, Caster::EXCLUDE_VERBOSE);
100+
}
101+
87102
public function testReflectionParameter()
88103
{
89104
$var = new \ReflectionParameter(__NAMESPACE__.'\reflectionParameterFixture', 0);

0 commit comments

Comments
 (0)