From d159a4a03e036d7a4664fd02fe07ddf1480850a4 Mon Sep 17 00:00:00 2001 From: Nicolas Appriou Date: Wed, 1 Feb 2023 12:55:17 +0100 Subject: [PATCH] [HttpFoundation] Update http response test constraint signature --- testing.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/testing.rst b/testing.rst index 2e681c70543..30c0e87ab77 100644 --- a/testing.rst +++ b/testing.rst @@ -961,11 +961,11 @@ However, Symfony provides useful shortcut methods for the most common cases: Response Assertions ................... -``assertResponseIsSuccessful(string $message = '')`` +``assertResponseIsSuccessful(string $message = '', bool $verbose = true)`` Asserts that the response was successful (HTTP status is 2xx). -``assertResponseStatusCodeSame(int $expectedCode, string $message = '')`` +``assertResponseStatusCodeSame(int $expectedCode, string $message = '', bool $verbose = true)`` Asserts a specific HTTP status code. -``assertResponseRedirects(?string $expectedLocation = null, ?int $expectedCode = null, string $message = '')`` +``assertResponseRedirects(?string $expectedLocation = null, ?int $expectedCode = null, string $message = '', bool $verbose = true)`` Asserts the response is a redirect response (optionally, you can check the target location and status code). The excepted location can be either an absolute or a relative path. @@ -983,9 +983,13 @@ Response Assertions Asserts the response format returned by the :method:`Symfony\\Component\\HttpFoundation\\Response::getFormat` method is the same as the expected value. -``assertResponseIsUnprocessable(string $message = '')`` +``assertResponseIsUnprocessable(string $message = '', bool $verbose = true)`` Asserts the response is unprocessable (HTTP status is 422) +.. versionadded:: 7.1 + + The ``$verbose`` parameters were introduced in Symfony 7.1. + Request Assertions ..................