Skip to content

Commit d00e0f2

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Minor reword [FrameworkBundle] 15751 add documentation for assertThatForClient
2 parents 20a07a9 + 409a7f9 commit d00e0f2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

testing.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,19 @@ Browser Assertions
914914
``assertBrowserCookieValueSame(string $name, string $expectedValue, string $path = '/', string $domain = null, string $message = '')``
915915
Asserts the given cookie in the test Client is set to the expected
916916
value.
917+
``assertThatForClient(Constraint $constraint, string $message = '')``
918+
Asserts the given Constraint in the Client. Useful to use your custom asserts
919+
in the same way of built-in asserts (i.e. without passing the Client as argument)::
920+
921+
// add this method in some custom class imported in your tests
922+
protected static function assertMyOwnCustomAssert(): void
923+
{
924+
self::assertThatForClient(new SomeCustomConstraint());
925+
}
926+
927+
.. versionadded:: 5.4
928+
929+
The ``assertThatForClient()`` method was introduced in Symfony 5.4.
917930

918931
Crawler Assertions
919932
..................

0 commit comments

Comments
 (0)