Testing/PHPUnit

DevelopmentTeam


phpunit.de

Installation

To install via pear (http://pear.php.net):

$ pear channel-discover pear.phpunit.de
$ pear install phpunit/PHPUnit

Xdebug extension

http://xdebug.org

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:

  1. We can continue to write tests for standard mediawiki installation.
    1. Extending code coverage for test classes that are working now.
    2. Fixing test classes that are not working now.
    3. Starting on new classes.
  2. We can write tests for existing AboutUs customizations.
  3. We can start writing tests before we write code for new customizations.


Retrieved from "http://aboutus.com/index.php?title=Testing/PHPUnit&oldid=12080208"