@@ -10,6 +10,7 @@ The VarDumper Component
10
10
function that you can use instead of :phpfunction: `var_dump `.
11
11
12
12
.. versionadded :: 2.6
13
+
13
14
The VarDumper component was introduced in Symfony 2.6.
14
15
15
16
Installation
@@ -73,6 +74,33 @@ current PHP SAPI:
73
74
#. From time to time, run ``composer global update `` to have the latest
74
75
bug fixes.
75
76
77
+
78
+
79
+ Using the VarDumper Component in Your PHPUnit Test Suite
80
+ --------------------------------------------------------
81
+
82
+ The VarDumper component provides
83
+ :class: `a trait <Symfony\\ Component\\ VarDumper\\ Test\\ VarDumperTestTrait> `
84
+ that can help writting some of your tests for PHPUnit.
85
+ By adding::
86
+
87
+ use \Symfony\Component\VarDumper\Test\VarDumperTestTrait;
88
+
89
+ at the beginning of your test class declaration, you'll gain two new assertions:
90
+
91
+ :method: `Symfony\\ Component\\ VarDumper\\ Test\\ VarDumperTestTrait::assertDumpEquals `
92
+ verifies that the dump of the variable given as the second argument matches
93
+ the expected dump provided as a string in the first argument.
94
+
95
+ :method: `Symfony\\ Component\\ VarDumper\\ Test\\ VarDumperTestTrait::assertDumpMatchesFormat `
96
+ is like the previous method but accepts placeholders in the expected dump,
97
+ based on the ``assertStringMatchesFormat `` method provided by PHPUnit.
98
+
99
+ .. versionadded :: 2.7
100
+
101
+ The :class: `Symfony\\ Component\\ VarDumper\\ Test\\ VarDumperTestTrait ` was
102
+ introduced in Symfony 2.7.
103
+
76
104
DebugBundle and Twig Integration
77
105
--------------------------------
78
106
0 commit comments