You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our application we had set up a new logging channel and we were passing an array to log context with key exception. FoundationServiceProvider picks up this key and pushes it to LoggedExceptionCollection and that in turn makes tests fail that check response status.
This happens because FoundationServiceProvider listens to MessageLogged event and pushes $event->context['exception'] to LoggedExceptionCollection. TestResponse sees this exception and tries to cast it to string.
I'm not sure if exception key in log context should be treated as real exception. If this behavior is intended, we will adjust our code accordingly.
Steps To Reproduce:
Create a fresh laravel application
Change web.php route to include a log with exception array in context:
Description:
In our application we had set up a new logging channel and we were passing an array to log context with key
exception
. FoundationServiceProvider picks up this key and pushes it to LoggedExceptionCollection and that in turn makes tests fail that check response status.This happens because FoundationServiceProvider listens to
MessageLogged
event and pushes$event->context['exception']
toLoggedExceptionCollection
. TestResponse sees this exception and tries to cast it to string.I'm not sure if exception key in log context should be treated as real exception. If this behavior is intended, we will adjust our code accordingly.
Steps To Reproduce:
web.php
route to include a log withexception
array in context:ErrorException : Array to string conversion
The text was updated successfully, but these errors were encountered: