On Thursday 10 April 2008 19:52:58 Charles Hoffman wrote:

> Is it possible to create mock Zend_Db_Table and Zend_Db_Row classes that
> extend Zend_Db_Table_Abstract and Zend_Db_Row_Abstract, but simply
> operate on some in-memory data?  Is that even a sensible way to try to
> go about it?  Better still, might there already be a framework for doing
> this sort of thing?  The less boilerplate I need to do just to run some
> tests, the better.

I'm not sure if the following is what you are talking about but...

I've created automatic test for my Zend_Db_Table extends. I have 1:1 PHP files 
to database tables. For customer table I have Customer.php and so on. My 
tester then loads all these files, reads the reference maps and dependent 
tables and begins to insert, modify and delete one table at a time. It 
understands the relations, so that all tables with foreign keys will be 
tested. It reads the metadata of the table from the actual real database and 
compares that to the reference maps and dependent tables.

All in all, this automatic test with real database is rather fast on my 
development computer and it also tells me to add missing references. I think 
it's good to have real database, because of possible triggers or other such 
proses.

This automatic testing is still work in progress, but I'd gladly finish it up 
and upload somewhere.

> Thanks in advance
> --chuck--

-- 
Teemu Valimaki <[EMAIL PROTECTED]>

Reply via email to