Extension:MWUnit/Running tests

This page details how to run tests.

Running tests on the wikiEdit

The mwunit-runtests user right is required for running tests via the special page.

There are several ways to run the tests that you have written via the wiki. The most obvious way is via the test page itself. In the sidebar, there should be a button under "Unit testing" labeled "Run unit tests".

It is also possible to run all tests that cover a certain template. This can be done by navigating to the template and clicking the button in the sidebar labeled "Run associated unit tests".

If you are using a skin that does not have a sidebar, you can also use the keyboard shortcut [Alt+Shift+a]

Another way to run tests is through the special page Special:UnitTests. The special page can run all tests in the given group and individual test cases.

The command-line test runnerEdit

The command-line test runner is used to execute tests through the command-line via a maintenance script. The maintenance script is located in the maintenance folder in the extension folder.

Usage: php runTests.php [--columns|--conf|--dbgroupdefault|--dbpass|--dbuser|--globals|--group|--help|--list-groups|--list-suites|--list-tests|--memory-limit|--mwdebug|--no-progress|--profiler|--quiet|--server|--test|--testdox|--page|--version|--wiki]

See alsoEdit