From 80c39186b4e6875fe5c78342c63b5d9334e0b22d Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Mon, 27 Apr 2020 15:33:18 +0200 Subject: [PATCH] Fix boolean value in assertSessionHasErrors --- src/Illuminate/Foundation/Testing/TestResponse.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Illuminate/Foundation/Testing/TestResponse.php b/src/Illuminate/Foundation/Testing/TestResponse.php index b2a5487b1805..2873db0732a8 100644 --- a/src/Illuminate/Foundation/Testing/TestResponse.php +++ b/src/Illuminate/Foundation/Testing/TestResponse.php @@ -1029,6 +1029,10 @@ public function assertSessionHasErrors($keys = [], $format = null, $errorBag = ' if (is_int($key)) { PHPUnit::assertTrue($errors->has($value), "Session missing error: $value"); } else { + if (is_bool($value)) { + $value = (string) $value; + } + PHPUnit::assertContains($value, $errors->get($key, $format)); } }