| 1 |
lars |
1 |
This is a test framework for MDB built using PHPUnit. Currently all
|
|
|
2 |
the tests from the metabase driver_test.php have been ported.
|
|
|
3 |
These tests directly access the MDB API, unlike driver_test.php
|
|
|
4 |
which uses the metabase wrapper - hopefully this framework should give
|
|
|
5 |
better feedback as to where or what caused when error are encountered. The
|
|
|
6 |
driver_test.php is still very useful for testing the metabase
|
|
|
7 |
compatability.
|
|
|
8 |
|
|
|
9 |
Usage:
|
|
|
10 |
In order for the tests to work they need to access a database called
|
|
|
11 |
"driver_test". This database is created in the manager test. If you have
|
|
|
12 |
problems running the manager test or the driver you are using does not yet
|
|
|
13 |
provide the necessary methods you may create the database manually. In the
|
|
|
14 |
future we will probably provide SQL files for every supported database.
|
|
|
15 |
|
|
|
16 |
To setup the tests
|
|
|
17 |
|
|
|
18 |
* requires PHPUnit to be installed
|
|
|
19 |
|
|
|
20 |
* requires MDB to be installed in a php include path or the tests need to be
|
|
|
21 |
moved into the MDB root path.
|
|
|
22 |
|
|
|
23 |
* copy the file test_setup.php.dist to test_setup.php
|
|
|
24 |
|
|
|
25 |
* edit test_setup.php. The array $testarray specifies which testcases
|
|
|
26 |
to carry out. Currently only MDB_usage_testcase is release quality.
|
|
|
27 |
$dbarray is an array of databases to test.
|
|
|
28 |
|
|
|
29 |
* point your browser at test.php for the results, and then fix the
|
|
|
30 |
bugs!
|
|
|
31 |
|
|
|
32 |
* by default test.php will use all tests in the testcases - if
|
|
|
33 |
you want to pick specific tests, use testchoose.php to pick just the
|
|
|
34 |
tests you want to run
|
|
|
35 |
|
|
|
36 |
Writing tests:
|
|
|
37 |
|
|
|
38 |
The tests are written using PHPUnit from pear so first make sure you
|
|
|
39 |
have the latest stable release, and have read the docs,
|
|
|
40 |
http://pear.php.net/manual/en/packages.phpunit.php
|
|
|
41 |
|
|
|
42 |
There are currently 4 test cases in development,
|
|
|
43 |
|
|
|
44 |
MDB_usage_testcase.php - port of the driver_test.php from metabase
|
|
|
45 |
MDB_api_testcase.php - test(s) for each method in the driver api
|
|
|
46 |
MDB_manager_testcase.php - test(s) for each method in the manager api
|
|
|
47 |
MDB_bugs_testcase.php - each time a MDB bug is found a test should
|
|
|
48 |
be added here.
|
|
|
49 |
|