Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Class: component_test  - X-Ref

core_component related tests.

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(array $arguments, bool $expected)   X-Ref
Test that the get_plugin_list_with_file() function returns the correct list of plugins.

param: array $arguments
param: bool $expected

is_valid_plugin_name_provider()   X-Ref
Data provider for the is_valid_plugin_name function.

return: array

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.


test_has_monologo_icon()   X-Ref
Test for monologo icons check in plugins.

return: void