Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.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