Difference between revisions of "Testing/PHPUnit"

(Including the bits about how to run the phpunit tests)
m (PHPUnit moved to Testing/PHPUnit: Adding a little hierarchy to the the flat organizational structure. That way PHPUnit can turn into a disambiguation page in the future.)
 

(3 intermediate revisions by the same user not shown)



Line 4: Line 4:
 
[[phpunit.de]]
 
[[phpunit.de]]
  
=== Installation ===
+
== Installation ==
 
To install via pear (http://pear.php.net):
 
To install via pear (http://pear.php.net):
 
<pre>
 
<pre>
Line 22: Line 22:
 
</pre>
 
</pre>
  
=== Running the tests ===
+
== Running the tests ==
  
 
Then, in the /tests directory:
 
Then, in the /tests directory:
Line 30: Line 30:
 
will run all the working tests we have at the moment (just a few).
 
will run all the working tests we have at the moment (just a few).
  
=== Code coverage analysis ===
+
== Code coverage analysis ==
 
Currently these have to be done manually for each file (change the name of the test class):
 
Currently these have to be done manually for each file (change the name of the test class):
 
<pre>
 
<pre>
Line 45: Line 45:
 
# We can write tests for existing AboutUs customizations.
 
# We can write tests for existing AboutUs customizations.
 
# We can start writing tests before we write code for new customizations.
 
# We can start writing tests before we write code for new customizations.
 +
[[Category:DevelopmentTeam]]
 +
[[Category:Testing]]

Latest revision as of 02:38, 30 October 2007

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"