8000 Documented the new behavior of VarDumperTestTrait::assertDumpEquals · symfony/symfony-docs@336993c · GitHub
[go: up one dir, main page]

Skip to content

Commit 336993c

Browse files
committed
Documented the new behavior of VarDumperTestTrait::assertDumpEquals
1 parent 8e21247 commit 336993c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

components/var_dumper.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ This will provide you with two new assertions:
127127

128128
:method:`Symfony\\Component\\VarDumper\\Test\\VarDumperTestTrait::assertDumpEquals`
129129
verifies that the dump of the variable given as the second argument matches
130-
the expected dump provided as a string in the first argument.
130+
the expected dump provided as the first argument.
131131

132132
:method:`Symfony\\Component\\VarDumper\\Test\\VarDumperTestTrait::assertDumpMatchesFormat`
133133
is like the previous method but accepts placeholders in the expected dump,
@@ -152,10 +152,19 @@ Example::
152152
]
153153
EOTXT;
154154

155+
// if the first argument is a string, it must be the whole expected dump
155156
$this->assertDumpEquals($expectedDump, $testedVar);
157+
158+
// if the first argument is not a string, assertDumpEquals() dumps it
159+
// and compares it with the dump of the second argument
160+
$this->assertDumpEquals($testedVar, $testedVar);
156161
}
157162
}
158163

164+
.. versionadded:: 4.1
165+
The possibility of passing non-string variables as the first argument of
166+
``assertDumpEquals()`` was introduced in Symfony 4.1.
167+
159168
Dump Examples and Output
160169
------------------------
161170

0 commit comments

Comments
 (0)
0