Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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

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.