Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Tests finder

Copyright: 2012 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 207 lines (7 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: tests_finder  - X-Ref

Finds components and plugins with tests

get_components_with_tests($testtype)   X-Ref
Returns all the components with tests of the specified type

return: array
param: string $testtype The kind of test we are looking for

get_all_plugins_with_tests($testtype)   X-Ref
Returns all the plugins having tests

return: array  all the plugins having tests
param: string $testtype The kind of test we are looking for

get_all_subsystems_with_tests($testtype)   X-Ref
Returns all the subsystems having tests

Note we are hacking here the list of subsystems
to cover some well-known subsystems that are not properly
returned by the {@link get_core_subsystems()} function.

return: array all the subsystems having tests
param: string $testtype The kind of test we are looking for

get_all_directories_with_tests($testtype)   X-Ref
Returns all the directories having tests

return: array all directories having tests
param: string $testtype The kind of test we are looking for

directory_has_tests($dir, $testtype)   X-Ref
Returns if a given directory has tests (recursively)

return: bool if a given directory has tests (true) or no (false)
param: string $dir full path to the directory to look for phpunit tests
param: string $testtype phpunit|behat

get_regexp($testtype)   X-Ref
Returns the regular expression to match by the test files

return: string
param: string $testtype