Status: Unverified Fix
Affects Version/s: 3.0.10, 3.1.0-dev
Component/s: Test Suite
Environment:PHP 5.2.17, PHP 5.3.10, Oracle XE 11g, Firebird 2.5, MSSQL 2008, 2012 RC0, PHPUnit 3.6.10
It is currently not possible to run tests on all of our supported databases. This is in part due to PHPUnit not supporting them, and partly by some databases not being to perform the DROP DATABASE command.
Firebird and raw ODBC are unsupported by PHPUnit, so the Firebird, MSSQL 2000+, and MSSQL via ODBC DBALs cannot be tested. It is possible to create drivers in PHPUnit for these fairly easily, as we have done so for MSSQL Native. Unfortunately, this becomes compounded by the fact that the PDO Firebird module in PHP 5 creates memory corruption and is incapable of running the tests, at least in Windows (report). Using their provided ODBC driver, we can perform the test over ODBC for PHPUnit, but we now have MSSQL and Firebird sharing the same ODBC driver, which PHPUnit doesn't handle since there is no way to tell what the actual driver being used is. To work around this, the testing config file will take a custom DSN parameter for those two database systems which is loaded as a raw ODBC connection to PHPUnit.
Some database systems provide only a single database, so they do not support the DROP DATABASE command. These include Firebird, Oracle XE, and SQLite. SQLite is easily created on the fly, so tests currently just delete the file. Firebird supports it, but the command must be issued through the isql application. Oracle XE is rather convulated as it's designed to only have one database since it's an express version. To actually make a new database, you need to stop the XE service, create a new directory structure within the Oracle program file folder, set up a new service, and so on. So, it is much faster to drop all of the tables and purge other generator, sequence, and relationship tables.
The linked pull request addresses all of these issues and fixes a few other issues:
- Capitalize fixture tables and columns when creating the XML dataset so that Firebird tests run correctly
- On database drop failure, drop all tables
- Provide cleanup utilities for databases that cannot be dropped or easily re-created.
DbUnit drivers can be found here: https://github.com/phpbb/dbunit/tree/phpbb