diff --git a/src/Illuminate/Foundation/Testing/TestResponse.php b/src/Illuminate/Foundation/Testing/TestResponse.php index 087af21093a7..6c1f9fd67fab 100644 --- a/src/Illuminate/Foundation/Testing/TestResponse.php +++ b/src/Illuminate/Foundation/Testing/TestResponse.php @@ -746,7 +746,7 @@ public function assertSessionHasErrors($keys = [], $format = null, $errorBag = ' $errors = app('session.store')->get('errors')->getBag($errorBag); foreach ($keys as $key => $value) { - if (is_int($value)) { + if (is_int($key)) { PHPUnit::assertTrue($errors->has($value), "Session missing error: $value"); } else { PHPUnit::assertContains($value, $errors->get($key, $format));