blob: ac07978d3e60dc036b3afa30bf1643906c0530f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
Running Tests
=============
Prerequisites
=============
PHPUnit
-------
phpBB unit tests use PHPUnit framework. Version 3.5 or better is required
to run the tests. PHPUnit prefers to be installed via PEAR; refer to
http://www.phpunit.de/ for more information.
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
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. An example
for mysqli can be found below. More information on configuration options can be
found on the wiki (see below).
<?php
$dbms = 'mysqli';
$dbhost = 'localhost';
$dbport = '';
$dbname = 'database';
$dbuser = 'user';
$dbpasswd = 'password';
Alternatively you can specify parameters in the environment, so e.g. the following
will run phpunit with the same parameters as in the shown test_config.php file:
$ PHPBB_TEST_DBMS='mysqli' PHPBB_TEST_DBHOST='localhost' \
PHPBB_TEST_DBNAME='database' PHPBB_TEST_DBUSER='user' \
PHPBB_TEST_DBPASSWD='password' phpunit
Running
=======
Once the prerequisites are installed, run the tests from the project root directory (above phpBB):
$ phpunit
More Information
================
Further information is available on phpbb wiki:
http://wiki.phpbb.com/display/DEV/Unit+Tests
|