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.

Differences Between: [Versions 310 and 311] [Versions 39 and 311]

Unit tests for /lib/componentlib.class.php.

Copyright: 2011 Tomasz Muras
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 199 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

componentlib_test:: (2 methods):
  test_component_installer()
  test_lang_installer()

testable_lang_installer:: (4 methods):
  protected_is_queued()
  protected_add_to_queue()
  install_language_pack()
  get_parent_language()


Class: componentlib_test  - X-Ref

Unit tests for /lib/componentlib.class.php.

test_component_installer()   X-Ref
No description

test_lang_installer()   X-Ref
Test the public API of the {@link lang_installer} class.


Class: testable_lang_installer  - X-Ref

Testable lang_installer subclass that does not actually install anything
and provides access to the protected methods of the parent class

protected_is_queued($langcode = '')   X-Ref


protected_add_to_queue($langcodes)   X-Ref


install_language_pack($langcode)   X-Ref
Simulate lang pack installation via component_installer.

Language packages 'de_du' and 'de_kids' reported as installed
Language packages 'cs' and 'de' reported as up-to-date
Language package 'xx' returns download error
All other language packages will throw an unknown exception


get_parent_language($langcode)   X-Ref
Simulate detection of parent language.