project:unittests
Differences
This shows you the differences between two versions of the page.
project:unittests [2025/07/21 01:31] – created mnewnham | project:unittests [2025/07/21 03:36] (current) – mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Unit Testing ====== | ====== Unit Testing ====== | ||
+ | <WRAP warning> | ||
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. | 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 '' | ||
+ | |||
+ | ===== Test Execution ===== | ||
+ | |||
+ | < | ||
+ | phpunit unittest --bootstrap unittest/ | ||
+ | </ | ||
+ | |||
+ | Where the < | ||
+ | |||
+ | |||
project/unittests.txt · Last modified: by mnewnham