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

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