[], 'UI:CSVReport-Value-ChangeIssue' => ['arg1'], 'UI:CSVReport-Value-NoMatch' => ['arg1'], 'UI:CSVReport-Value-NoMatch-PossibleValues' => ['arg1', 'arg2'], 'UI:CSVReport-Value-NoMatch-NoObject' => ['arg1'], 'UI:CSVReport-Value-NoMatch-NoObject-ForCurrentUser' => ['arg1'], 'UI:CSVReport-Value-NoMatch-SomeObjectNotVisibleForCurrentUser' => ['arg1'], ]; $sCompiledLanguagesFilePath = APPROOT . 'env-' . \utils::GetCurrentEnvironment() . '/dictionaries/languages.php'; $this->assertFileExists($sCompiledLanguagesFilePath, 'We must have an existing compiled language.php file in the current env !'); require_once($sCompiledLanguagesFilePath); $this->assertNotEmpty(Dict::GetLanguages(), 'the languages.php file exists but didn\'t load any language'); foreach (glob(APPROOT . 'env-' . \utils::GetCurrentEnvironment() . '/dictionaries/*.dict.php') as $sDictFile) { if (preg_match('/.*\\/(.*).dict.php/', $sDictFile, $aMatches)) { $sLangCode = $aMatches[1]; $sLanguageCode = strtoupper(str_replace('-', ' ', $sLangCode)); Dict::SetUserLanguage($sLanguageCode); foreach ($aLabelsToTest as $sLabelKey => $aLabelArgs) { echo "Testing $sDictFile, label $sLabelKey with " . \var_export($aLabelArgs, true) . "\n"; try { $sLabelValue = Dict::Format($sLabelKey, ...$aLabelArgs); //$this->debug($sLabelValue); } catch (\ValueError $e) { $aFailedLabels[] = $sLabelKey; $this->debug([ 'exception' => $e->getMessage(), 'trace' => $e->getTraceAsString(), 'label_name' => $sLabelKey, 'label_args' => $aLabelArgs, ]); } } $this->assertEquals([], $aFailedLabels, "$sDictFile : test fail for lang $sLangCode and labels (" . implode(", ", $aFailedLabels) . ')'); } } } }