Replies: 1 comment
-
Stubbing Db is not something we promote. If you stub the DB, all you are testing is that your code invokes the right method and not the behavior. Database is completely in your control, there are no side-effects of running the real query and hence stubbing is over engineering with negative benefits |
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
-
Once again !.
Im trying to write unit test for API endpoint rc/radars . I would like to stub db statement Database.raw() to not hit my DB. I read also documentation and found ioc.fake() but its not working for database provider.
I'm getting different errors based on what I'm actually trying... for example when I try to stub Database object with raw method I get raw is not defined on database object.
Is there any way how to stub/fake database provider to not hit database ? except wrapping sql execution into standalone method ?
Beta Was this translation helpful? Give feedback.
All reactions