|
From: Chris C. <ch...@w3...> - 2009-12-04 06:37:10
|
Use a separate database and as part of the test fixture set-up rebuild a fresh DB schema so that you have a clean text fixture for each test. However, (and I know from experience), this is slow when you have thousands of tests. You can alternatively use a transaction-per-test concept where you rollback the transaction in your fixture tear-down, however this makes some wild assumptions about the DB work your code does. Other approaches taken (in highly OO environments) involve avoiding writes the database entirely and dealing with purely with arrays/collections in the test environment. Gerard Meszaros talks about this a little in his xUnit Test Patterns book, which I would recommend as a purchase as a side note. http://xunitpatterns.com/Database%20Patterns.html e: ch...@w3... t (en): http://twitter.com/d11wtq t (it): http://twitter.com/cosadici Il giorno 04/dic/2009, alle ore 16.57, ak ak ha scritto: > Hello friends, I want to test my database with simpletest. > I have not found any tutorial/example of database testing,Is it possible to test > database with simpletest? > Thanks to all > akaash > > > > > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > _______________________________________________ > Simpletest-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpletest-support |