Leader of Birmingham.pm [pm.org] and a CPAN author [cpan.org]. Co-organised YAPC::Europe in 2006 and the 2009 QA Hackathon, responsible for the YAPC Conference Surveys [yapc-surveys.org] and the QA Hackathon [qa-hackathon.org] websites. Also the current caretaker for the CPAN Testers websites and data stores.
If you really want to find out more, buy me a Guinness
I want a module that can do two things;
The aim would be to run a test suite, which outputs a file with all the necessary information passing between the application and the database, which can then be munged into a format which can replace the database using Test::MockObject.
The problem I've encountered so far is that, DBI::Profile only records the SQL queries being sent, and it recreates the profile file for each invocation rather than appends data. However, using this as a starting point, there should be no reason that I can't implement something similar. I can't find anything that looks like it can do what I want on CPAN (or Randy Kobes' site), although that may just be me not asking the right question. Note that I'm not after DBD::Mock, as I'm not testing the database calls, just that the munging of the result set is as expected.
So has anyone else thought of something like this? Can DBI::Profile do this? Is there some other module that already does this, or something similar? Is anyone working on a soon to be released distribution that does this? I did wonder whether, like HTTP::Recorder uses HTTP::Proxy, whether I could use DBI::ProxyServer, but that looks to be far too much effort for what I want.
I'm a big advocate of using Test::MockObject instead of trashing someones database. So I thought making life a little easier for anyone who wants to do the same, but can't face writing all the data files for the test suite, would be a good thing.
In other news Mark Stosberg released another version of CGI::Uploader. I have been meaning to finish off the Test::MockObject style testing for him for several months. Having DBI::Recorder would make that so much easier