Difference between revisions of "Testing/PHPUnit"
(Articulating and standardizing our testing frameworks) |
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.) |
||
|
(4 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
[[phpunit.de]] | [[phpunit.de]] | ||
| − | + | == Installation == | |
To install via pear (http://pear.php.net): | To install via pear (http://pear.php.net): | ||
<pre> | <pre> | ||
| Line 21: | Line 21: | ||
zend_extension="/usr/local/php/modules/xdebug.so" | zend_extension="/usr/local/php/modules/xdebug.so" | ||
</pre> | </pre> | ||
| + | |||
| + | == Running the tests == | ||
| + | |||
| + | Then, in the /tests directory: | ||
| + | <pre> | ||
| + | $ php RunTests.php | ||
| + | </pre> | ||
| + | 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): | ||
| + | <pre> | ||
| + | $ phpunit --report /report BankAccountTest | ||
| + | </pre> | ||
| + | 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. | ||
| + | [[Category:DevelopmentTeam]] | ||
| + | [[Category:Testing]] | ||
Latest revision as of 02:38, 30 October 2007
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.
