Running Unit Tests

From Joomla! Documentation

Revision as of 02:30, 18 October 2014 by SniperSister (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Merge Notice

It has been suggested that this article or section be merged with Running_Automated_Tests_for_the_Joomla_CMS#Running_Unit_Tests. (Discuss). Proposed since 9 years ago.

Running the Entire Test Suite[edit]

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

cd /path/to/joomla/tests/unit

Specifying a Directory of Tests to Run[edit]

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[edit]

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.