Re: PEAR Quality (vs. Quantity) RFC
| From: | Alexander Merz | Date: | Wed, 14 May 2003 09:45:01 +0000 |
| Subject: | Re: PEAR Quality (vs. Quantity) RFC | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16234@lists.php.net to get a copy of this message | ||
Wolfram Kriesing wrote:
common 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.