![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Re: How to mock results to repeated $sth->execute() calls (DBD::Mock::Session)by ChemBoy (Priest) |
on Dec 11, 2005 at 14:10 UTC ( [id://515838]=note: print w/replies, xml ) | Need Help?? |
This is a slightly thorny problem—when I was working on some tests with DBD::Mock, I tried to come up with a good general solution for this issue and the possibility of failure during a prepare call, and ran out of time to do it. I did come up with an adequate hack for this part, though:
To use it, you'd put an entry in the session looking like {statement => "select ...", results => [] } at the place you expected the prepare to happen, then normal entries for the execute calls. Hope this helps! If God had meant us to fly, he would *never* have given us the railroads. --Michael Flanders
In Section
Seekers of Perl Wisdom
|
|