Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are 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