Running Tests ============= Prerequisites ============= PHPUnit ------- phpBB unit tests use the PHPUnit framework (see http://www.phpunit.de for more information). Version 3.5 or higher is required to run the tests. PHPUnit can be installed via Composer together with other development dependencies as follows. $ cd phpBB $ php ../composer.phar install --dev $ cd .. PHP extensions -------------- Unit tests use several PHP extensions that board code does not use. Currently the following PHP extensions must be installed and enabled to run unit tests: - ctype (also a PHPUnit dependency) - dom (PHPUnit dependency) - json (also a phpBB dependency) Some of the functionality in phpBB and/or the test suite uses additional PHP extensions. If these extensions are not loaded, respective tests will be skipped: - apc (APC cache driver) - bz2 (compress tests) - interbase, pdo_firebird (Firebird database driver) - mysql, pdo_mysql (MySQL database driver) - mysqli, pdo_mysql (MySQLi database driver) - pcntl (flock class) - pdo (any database tests) - pgsql, pdo_pgsql (PostgreSQL database driver) - redis (https://github.com/nicolasff/phpredis, Redis cache driver) - simplexml (any database tests) - sqlite, pdo_sqlite (SQLite database driver, requires SQLite 2.x support in pdo_sqlite) - zlib (compress tests) Database Tests -------------- By default all tests requiring a database connection will use sqlite. If you do not have sqlite installed the tests will be skipped. If you wish to run the tests on a different database you have to create a test_config.php file within your tests directory following the same format as phpBB's config.php. Testing makes use of a seperate database defined in this config file and before running the tests each time this database is deleted. An example for mysqli can be found below. More information on configuration options can be found on the wiki (see below).