Setting up a testframework
Tarjei Huse <tarjei-y/[email protected]> Mon, 13 Feb 2006 13:21:21 +0100
| Newsgroups | gmane.comp.web.midgard.devel |
|---|---|
| Message-ID | <1139833282.9931.9.camel@localhost> |
Hi, I am planning to put together a testharness for the midgard php-api. Here's a quick outline. Please give input. The testharness will parse the schemafiles and define parts of the tests from those schemafiles. Based on the schmea, a set of generated testclasses will be created in a directory "objects". The layout will be: ObjectName.php <- The class that will be run extends the generated testclass _ObjectName.php <- the generated testclass Thus it is possible to add extra tests to all objects or to overide some tests that shouldn't or will not work. A separate object hierarcy will be generated for querybuildertests. Then I will make a test that will create a simple test database for testing, setting up a sitegroup and a user in that sitegroup. Then each testclass will be run in that sitegroup with a simple cycle: 1. create a testobject. -> Subelements in trees will have to create the object it will relate to as well. 2. run some tests on the object -> Check if guid is set -> Check if the values are the same as those created for the object. -> Try to update some values. 3. Test deleting the object The first basic tests will be fairly simple. A separate cycle is created for querybrowser objects: 1. Test simple queries 2. Test each for the different query types (add_constraint() etc) 3. Test some random input into different functions. Then at the root of the testharness you got test_all and test_querybuilder that set up the environment and run the tests. Kind regards, Tarjei