File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,35 @@ current PHP SAPI:
7373 #. From time to time, run ``composer global update `` to have the latest
7474 bug fixes.
7575
76+ Using the VarDumper Component in Your PHPUnit Test Suite
77+ --------------------------------------------------------
78+
79+ .. versionadded :: 2.7
80+ The :class: `Symfony\\ Component\\ VarDumper\\ Test\\ VarDumperTestTrait ` was
81+ introduced in Symfony 2.7.
82+
83+ The VarDumper component provides
84+ :class: `a trait <Symfony\\ Component\\ VarDumper\\ Test\\ VarDumperTestTrait> `
85+ that can help writting some of your tests for PHPUnit.
86+ You can use it by importing it into your test classes::
87+
88+ class YourTest extends \PHPUnit_Framework_TestCase
89+ {
90+ use \Symfony\Component\VarDumper\Test\VarDumperTestTrait;
91+
92+ // ...
93+ }
94+
95+ This will provide you with two new assertions:
96+
97+ :method: `Symfony\\ Component\\ VarDumper\\ Test\\ VarDumperTestTrait::assertDumpEquals `
98+ verifies that the dump of the variable given as the second argument matches
99+ the expected dump provided as a string in the first argument.
100+
101+ :method: `Symfony\\ Component\\ VarDumper\\ Test\\ VarDumperTestTrait::assertDumpMatchesFormat `
102+ is like the previous method but accepts placeholders in the expected dump,
103+ based on the ``assertStringMatchesFormat `` method provided by PHPUnit.
104+
76105DebugBundle and Twig Integration
77106--------------------------------
78107
You can’t perform that action at this time.
0 commit comments