[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/_test/tests/inc/ -> lang.php (summary)

(no description)

File Size: 238 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

lang_test:: (10 methods):
  findLanguages()
  findPlugins()
  findTemplates()
  loadLanguage()
  provideLanguageFiles()
  testObsolete()
  testPlaceholders()
  parsePlaceholders()
  providePlaceholders()
  testParsePlaceholders()


Class: lang_test  - X-Ref

Language file tests inspired by the script by schplurtz

findLanguages()   X-Ref
returen all languages except english

return: string[]

findPlugins()   X-Ref
Get all installed plugins

This finds all things that might be a plugin and does not care for enabled or not.

return: string[]

findTemplates()   X-Ref
Get all installed templates

This finds all things that might be a template and does not care for enabled or not.

return: string[]

loadLanguage($file)   X-Ref
Load the strings for the given language

param: string $lang
return: array

provideLanguageFiles()   X-Ref
Provide all the language files to compare

return: Generator

testObsolete($english, $foreign, $code, $file, $prefix = '')   X-Ref
Check for obsolete language strings

param: array $english key/value language pairs for English
param: array $foreign key/value language pairs for the foreign language
param: string $code language code of the foreign file
param: string $file the base file name the foreign keys came from
param: string $prefix sub key that is currently checked (used in recursion)

testPlaceholders($english, $foreign, $code, $file, $prefix = '')   X-Ref
Check for sprintf format placeholder equality

param: array $english key/value language pairs for English
param: array $foreign key/value language pairs for the foreign language
param: string $code language code of the foreign file
param: string $file the base file name the foreign keys came from
param: string $prefix sub key that is currently checked (used in recursion)

parsePlaceholders($string)   X-Ref
Parses the placeholders from a string and brings them in the correct order

This has its own test below.

param: string $string

providePlaceholders()   X-Ref
Dataprovider for the parsePlaceholder test

return: array[]

testParsePlaceholders($input, $expected)   X-Ref
Test the parsePlaceholder utility function above

param: string $input
param: array $expected