Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

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

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

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

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.

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

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

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

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

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

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

param: string $testtype
return: string