Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

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: 241 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

core_string_manager_standard_testcase:: (7 methods):
  test_string_manager_instance()
  test_get_language_dependencies()
  test_deprecated_strings()
  get_deprecated_strings_provider()
  test_validate_deprecated_strings_files()
  test_get_list_of_translations()
  test_get_list_of_countries()

testable_core_string_manager:: (2 methods):
  instance()
  get_all_deprecated_strings()


Class: core_string_manager_standard_testcase  - X-Ref

Tests for the API of the string_manager.

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