Actions

Difference between revisions of "Running Unit Tests"

From Joomla! Documentation

(New page: == Running the Entire Test Suite == The entire test suite can be run by simply entering the test directory and typing phpunit: <pre> cd /path/to/joomla/tests/unit phpunit </pre> == Sp...)
 
(added Testing and Bug Squad categories)
Line 1: Line 1:
 
 
== Running the Entire Test Suite ==
 
== Running the Entire Test Suite ==
  
Line 26: Line 25:
  
 
Will scan through the suite directory and run tests that contain JForm in the class name or in the method name.
 
Will scan through the suite directory and run tests that contain JForm in the class name or in the method name.
 +
 +
[[Category:Testing]][[Category:Bug Squad]]

Revision as of 18:53, 14 December 2011

Running the Entire Test Suite

The entire test suite can be run by simply entering the test directory and typing phpunit:

cd /path/to/joomla/tests/unit
phpunit


Specifying a Directory of Tests to Run

You can run a subset of tests by specifying the directory path of the tests that you want to run.

phpunit suite/libraries/joomla/utilities

Will run all of the tests in the specified directory and any subdirectory.


Using the --filter Parameter to Run Certain Tests

The --filter parameter allows you to run a specific subset of the entire test suite. The --filter parameter takes a regular expression that can be used to filter out tests.

phpunit --filter JForm

Will scan through the suite directory and run tests that contain JForm in the class name or in the method name.