project:unittests
This is an old revision of the document!
Unit Testing
This feature is in initial development. Feature may change substantially at any time
Unit testing can be done using PHPUnit testing. Testing can be done against any database that is available that you have admin rights on. The test creates tables, populates them with small amounts of data and drops them.
Setup
Configuration information for the tests is held in a configuration file adodb-unittest.ini. The file can be located anywhere in the PHP include path. The configuration is based on the driver name.
[mysqli] dsn= host=mysql-server.com user=root password=somepassword database=adodb-tester debug=0 parameters=
Setting | Description |
---|---|
dsn | Either use a connection DSN or specify the parameters usual |
host | The hostname associated with the database |
user | The connection username |
password | The connection password |
debug | Sets the debug mode |
parameters | To set parameters normally set by setConnectionParameter() , create a string in format key=value; Note that the parameters cannot be defined as constants, you must use the numeric or string equivalents |
Test Execution
phpunit unittest --bootstrap unittest/dbconnector.php <driver>
Where the <driver> name represents the ADOdb driver to use. For use of PDO drivers use the format pdo-<driver>. The driver name must follow the bootstrap file name
project/unittests.1753061770.txt.gz · Last modified: by mnewnham