Replies: 1 comment
-
I think I figured it out, preventLazyLoading only kicks in if the items returned is more than one. so if you have only one test entry returning, it will not be enforced in the test. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all. Has anyone used this during testing? I'm using it right now and it works as expected when I visit the project via web browser or with postman, but when I run the tests it doesn't throw the exception.
I didnt find any additional information on using this in testing, I don't know if it's possible or if there is something else to do besides adding the code in the AppServiceProvider.
APP_ENV in phpunit.xml file is set to testing and in AppServiceProvider boot() Im using
Model::preventLazyLoading(!app()->isProduction());
Thanks
Beta Was this translation helpful? Give feedback.
All reactions