Unit Tests For The Platform

From Joomla! Documentation

Revision as of 00:25, 17 August 2011 by Jmcameron (Talk | contribs)

This is a very early stage document about running unit tests on the platform.

To run tests on the platform you will need to install PHPUnit 3.5. You may also need to update your version of PEAR to the current version. If you are using Ubuntu as your OS you will need to be at minimum on version 10.10 to update to PEAR's current package using the standard packages in the software center. You will also need to have xdebug with the current version installed.

PHP must be at least version 5.2.7 but 5.3.3 is recommended.

To install, go to the command line and type:

pear channel-discover
pear channel-discover
pear channel-discover
pear install -f --alldeps phpunit/PHPUnit
pear install -f --alldeps phpunit/DBUnit
pear install -f --alldeps phpunit/PHPUnit_MockObject
pear install -f --alldeps PHP_CodeSniffer

At this point you should be able to navigate to the tests folder and type phpunit at the prompt to start the tests.

phpunit --help 

will give you a list of options.