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.

Unit tests for current_language() in moodlelib.php.

Copyright: 2022 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 196 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes


Class: moodlelib_current_language_test  - X-Ref

Unit tests for current_language() in moodlelib.php.

Class: testable_string_manager_for_current_language_tests  - X-Ref

Test helper class for test which need Moodle to think there are other languages installed.

set_fake_list_of_installed_languages(array $installedlanguages)   X-Ref
Start pretending that the list of installed languages is other than what it is.

You need to pass in an array like ['en' => 'English', 'fr' => 'French'].

param: array $installedlanguages the list of languages to assume are installed.

reset_installed_languages_override()   X-Ref
Must be called at the end of any test which called set_fake_list_of_installed_languages to reset things.


get_list_of_translations($returnall = false)   X-Ref
No description