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.

Class: core_component_testcase  - X-Ref

Class core_component_testcase.

setUp()   X-Ref
To be changed if number of subsystems increases/decreases,
this is defined here to annoy devs that try to add more without any thinking,
always verify that it does not collide with any existing add-on modules and subplugins!!!


tearDown()   X-Ref
No description

test_get_core_subsystems()   X-Ref
No description

test_deprecated_get_core_subsystems()   X-Ref
No description

test_get_plugin_types()   X-Ref
No description

test_deprecated_get_plugin_types()   X-Ref
No description

test_get_plugin_list()   X-Ref
No description

test_deprecated_get_plugin_list()   X-Ref
No description

test_get_plugin_directory()   X-Ref
No description

test_deprecated_get_plugin_directory()   X-Ref
No description

test_get_subsystem_directory()   X-Ref
No description

test_is_valid_plugin_name()   X-Ref
No description

test_normalize_componentname()   X-Ref
No description

test_normalize_component()   X-Ref
No description

test_deprecated_normalize_component()   X-Ref
No description

test_get_component_directory()   X-Ref
No description

test_deprecated_get_component_directory()   X-Ref
No description

test_get_subtype_parent()   X-Ref
No description

test_get_subplugins()   X-Ref
No description

test_get_plugin_types_with_subplugins()   X-Ref
No description

test_get_plugin_list_with_file()   X-Ref
No description

test_get_component_classes_in_namespace()   X-Ref
No description

classloader_provider()   X-Ref
Data provider for classloader test


test_classloader($psr0, $psr4, $classname, $includedfiles)   X-Ref
Test the classloader.

param: array $psr0 The PSR-0 namespaces to be used in the test.
param: array $psr4 The PSR-4 namespaces to be used in the test.
param: string $classname The name of the class to attempt to load.
param: string $includedfiles The file expected to be loaded.

psr_classloader_provider()   X-Ref
Data provider for psr_classloader test


test_psr_classloader($psr0, $psr4, $classname, $file)   X-Ref
Test the PSR classloader.

param: array $psr0 The PSR-0 namespaces to be used in the test.
param: array $psr4 The PSR-4 namespaces to be used in the test.
param: string $classname The name of the class to attempt to load.
param: string|bool $file The expected file corresponding to the class or false for nonexistant.

get_class_file_provider()   X-Ref
Data provider for get_class_file test


test_get_class_file($classname, $prefix, $path, $separators, $result)   X-Ref
Test the PSR classloader.

param: string $classname the name of the class.
param: string $prefix The namespace prefix used to identify the base directory of the source files.
param: string $path The relative path to the base directory of the source files.
param: string[] $separators The characters that should be used for separating.
param: string|bool $result The expected result to be returned from get_class_file.

test_get_component_list_contains_all_components()   X-Ref
Confirm the get_component_list method contains an entry for every component.


test_get_component_names()   X-Ref
Test the get_component_names() method.