Manual:Hooks/UnitTestsList

From MediaWiki.org
Jump to: navigation, search
UnitTestsList
Available from version 1.17.0 (r68673)
Allows extensions to extend core's PHPUnit test suite
Define function:
public static function onUnitTestsList( array &$paths ) { ... }
Attach hook:
$wgHooks['UnitTestsList'][] = 'MyExtensionHooks::onUnitTestsList';
Called from: File(s): ExtensionsTestSuite.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:UnitTestsList extensions.

UnitTestsList allows registration of additional test suites to execute under PHPUnit. Extensions can append paths to files to the $paths array, and since MediaWiki 1.24, can specify paths to directories, which will be scanned recursively for any test case files with the suffix "Test.php".

Since MediaWiki 1.28 test case files with the suffix "Test.php" in the extension subdirectory "tests/phpunit" are automatically appended; this render this hook less useful in the general case, but still useful for specific file structures.

See also[edit]