Typesetter-Original-gtbu/phpunit/Include/LanguagesTest.php
2021-09-08 19:52:21 +02:00

27 lines
553 B
PHP

<?php
class phpunit_Languages extends gptest_bootstrap{
function testKeys(){
global $langmessage, $languages;
//get en language
\gp\tool::GetLangFile('main.inc','en');
$keys_en = array_keys($langmessage);
//compare keys in other languages
foreach($languages as $code => $lang){
$langmessage = array();
\gp\tool::GetLangFile('main.inc',$code);
$keys = array_keys($langmessage);
$diff = array_diff($keys_en,$keys);
self::assertEmpty($diff,'Keys missing in '.$lang.' ('.$code.') language file: '.pre($diff));
}
}
}