From 1ae8ffda89c550b08b920e87c5dffe49ba4be141 Mon Sep 17 00:00:00 2001 From: Noboru Shiroiwa <14008307+nshiro@users.noreply.github.com> Date: Fri, 19 Aug 2022 23:46:16 +0900 Subject: [PATCH] [9.x] Add statusText for an assertion message (#43774) --- src/Illuminate/Testing/TestResponse.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Testing/TestResponse.php b/src/Illuminate/Testing/TestResponse.php index 86dccf7d2339..873f9f41e93f 100644 --- a/src/Illuminate/Testing/TestResponse.php +++ b/src/Illuminate/Testing/TestResponse.php @@ -212,7 +212,9 @@ protected function statusMessageWithDetails($expected, $actual) } } - return "Expected response status code [{$expected}] but received {$actual}."; + $statusText = $this->statusText(); + + return "Expected response status code [{$expected}] but received {$actual} ({$statusText})."; } /**