Testing/PHPUnit
Installation
To install via pear (http://pear.php.net):
$ pear channel-discover pear.phpunit.de $ pear install phpunit/PHPUnit
Xdebug extension
To do code-coverage analysis, you need to install:
$ pecl install xdebug-beta
Also need to add this line to your php.ini (change path to the correct one):
zend_extension="/usr/local/php/modules/xdebug.so"
Running the tests
Then, in the /tests directory:
$ php RunTests.php
will run all the working tests we have at the moment (just a few).
Code coverage analysis
Currently these have to be done manually for each file (change the name of the test class):
$ phpunit --report /report BankAccountTest
Code coverage reports are then in the /tests/report directory.
next steps and how things should be done
We have several options:
- We can continue to write tests for standard mediawiki installation.
- Extending code coverage for test classes that are working now.
- Fixing test classes that are not working now.
- Starting on new classes.
- We can write tests for existing AboutUs customizations.
- We can start writing tests before we write code for new customizations.