phpBB

Development Wiki

Running Unit Tests

From phpBB Development Wiki

Revision as of 04:49, 5 September 2011 by Oleg (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Running tests on your system

This is a job for your command-line/shell. First, you need to install PHPUnit to your server: http://www.phpunit.de/ In order to install PHPUnit correctly, you need to run the following commands:

pear channel-update pear.php.net
pear install PEAR-1.9.1
pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear install --alldeps phpunit/PHPUnit

Once that is done: You need to switch into the root directory of the git-repo. And then simply run

Linux:
phpunit
Windows:
YOUR_DIRECTORY_WHERE_THE_FILE_IS/phpunit.bat

(Exp. C:/xampp/php/phpunit.bat )

Afterwards you should see something like:

PHPUnit 3.4.11 by Sebastian Bergmann.

............................................................  60 / 688
............................................................ 120 / 688
IIIIIIIIIII................................................. 180 / 688
............................................................ 240 / 688
............................................................ 300 / 688
............................................................ 360 / 688
............................................................ 420 / 688
............................................................ 480 / 688
............................................................ 540 / 688
............................................................ 600 / 688
............................................................ 660 / 688
............................

Time: 5 seconds, Memory: 13.00Mb

OK, but incomplete or skipped tests!
Tests: 688, Assertions: 878, Incomplete: 11.

If there are no errors, your test was successful. Otherwise either a test was wrong, or the functionality itself is wrong. Then you should go and fix it.