On Sat, Jan 10, 2004 at 06:51:38PM -0500, Chris Winters wrote: > In the context of developing tests for a system with pluggable > persistence schemes I found myself needing something like a mock DBD > implementation. This would be loaded and instantiated like a normal DBD > through the connect() call and would behave like a normal DBD. > > But instead of storing and fetching data it would simply store the SQL > statements passed to it via prepare() and the bound parameters used in > bind_param() and execute() calls. These could be returned via statement > properties or other appropriate means. It would also be similar to a > Test::MockObject object in that you could hardwire the return values > programmatically. > > I didn't find anything like this around, but it's hard to do an > exhaustive search for something in this area -- people create their > own, refer to it by different terms, etc. Is anyone familiar with this?
DBD::NullP (supplied with the DBI) nearly fits the bill. I'd happily accept a patch to make it fit better. Tim.