From c84ec8171de8c041021b740a51bec4375a4abd35 Mon Sep 17 00:00:00 2001 From: gam6itko Date: Thu, 26 Oct 2023 10:49:04 +0300 Subject: [PATCH] TestResponse::assertStatus display response body on assert fail --- src/Http/TestResponse.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Http/TestResponse.php b/src/Http/TestResponse.php index e6d3d04..01bff34 100644 --- a/src/Http/TestResponse.php +++ b/src/Http/TestResponse.php @@ -61,10 +61,11 @@ public function assertStatus(int $status): self $this->response->getStatusCode(), $status, \sprintf( - "Received response status code [%s : %s] but expected %s.", + "Received response status code [%s : %s] but expected %s. Body: %s", $this->response->getStatusCode(), $this->response->getReasonPhrase(), - $status + $status, + (string) $this->response->getBody(), ) );