PHPKitchen has this new posting today with a pretty good idea for testing out test methods that write to the database (with SimpleTest).
He gives a few ways that you can test your methods, including: "the most extreme" (checking anything and everything), "the dumbass approach" (sending the objects to the db and confirm with low level calls), and "mathematical purity" (a complete set of operations).
The catch is that you need to be able to clean up before and after the tests, so you will have to add methods like Fruit::deleteAll(), etc. This is what I mean by a complete set of operations, coding one means that you have to code the lot. The problem is bootstrapping this process so that you can still develop incrementally. My prefered approach is to start with 1 and once up switch to 3. I still keep some ones around to simulate failure conditions.




