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 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

Unit tests for localization support in lib/moodlelib.php

Copyright: 2013 David Mudrak <david@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 249 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes


Class: string_manager_standard_test  - X-Ref

Tests for the API of the string_manager.

Unit tests for localization support in lib/moodlelib.php

test_string_manager_instance()   X-Ref
No description

test_get_language_dependencies()   X-Ref
No description

test_deprecated_strings()   X-Ref
No description

get_deprecated_strings_provider()   X-Ref
Return all deprecated strings.

return: array

test_validate_deprecated_strings_files($string)   X-Ref
This test is a built-in validation of deprecated.txt files in lang locations.

It will fail if the string in the wrong format or non-existing (mistyped) string was deprecated.

param: string      $string     The string to be tested

test_get_list_of_translations()   X-Ref
Test for $CFG->langlist (without installation of additional languages)


test_get_list_of_countries()   X-Ref
Test {@see core_string_manager_standard::get_list_of_countries()} under different conditions.


Class: testable_core_string_manager  - X-Ref

Helper class providing testable string_manager

instance($otherroot, $localroot = null, $usecache = false, array $translist = array()   X-Ref
Factory method

param: string $otherroot full path to the location of installed upstream language packs
param: string $localroot full path to the location of locally customized language packs, defaults to $otherroot
param: bool $usecache use application permanent cache
param: array $translist explicit list of visible translations
param: string $menucache the location of a file that caches the list of available translations
return: testable_core_string_manager

get_all_deprecated_strings()   X-Ref
No description