For mocking a database, we use DBD::Mock. Setting up the object is a bit exhausting, but in the end, it works greatly.
See also Test::Spec::Mocks for mock objects that can verify they arguments and return different values based on them.
Also note that you should mock the DB only for the layers that talk to it directly. For all the layers above that, you should mock the directly underlying layer and forget about what's below.
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
In reply to Re: Mock+ object with recording?
by choroba
in thread Mock+ object with recording?
by skef
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |