Re: PEAR Quality (vs. Quantity) RFC
| From: | Davey | Date: | Wed, 14 May 2003 12:28:25 +0000 |
| Subject: | Re: PEAR Quality (vs. Quantity) RFC | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16236@lists.php.net to get a copy of this message | ||
Alexander Merz wrote:
Wolfram Kriesing wrote:I like that idea :) - Daveycommon setup to be defined. The easiest for the one who has to run the test, will be using Mock-Objects, since you dont have to set up the DB-connection or anything.Just as simple solution: We could provide a mock-driver for DB and MDB, ie: $db=DB::connect("mock://path/to/mock.xml"); mock.xml is test specific and clould looks like this: <mock><query> <sql>SELECT a,b FROM myTable where a='Alice'</sql <result> <row> <col name="a">Alice</col> <col name="b">Bob</col> </row> </result> </query></mock> The mock driver just looks for the given SQL-Statement and returns the result defined in the file. This should solves the most problems with DB-related packages.