Fixes syntax error in "system/lv" lang, write test to prevent further breakages

This commit is contained in:
Samuel Georges 2015-07-29 07:58:08 +10:00
parent 690d7f0a02
commit 3a2b94829a
2 changed files with 24 additions and 1 deletions

View File

@ -154,7 +154,7 @@ return [
'mailgun_secret_comment' => 'Ievadiet savu Mailgun API kodu.',
'mandrill' => 'Mandrill',
'mandrill_secret' => 'Mandrill Secret',
'mandrill_secret_comment' => 'Ievadiet savu Mandrill API kodu.'
'mandrill_secret_comment' => 'Ievadiet savu Mandrill API kodu.',
'drivers_hint_header' => 'Dziņi nav instalēti',
'drivers_hint_content' => 'Šai pasta metodei nepieciešams spraudnis ":plugin" instalējiet to pirms pasta sūtīšanas.'
],

View File

@ -20,4 +20,27 @@ class TranslatorTest extends TestCase
$this->assertCount(1, $messages);
$this->assertEquals('The name must be at least 5 characters.', $messages->all()[0]);
}
public function testValidCoreLanguageFiles()
{
$translator = $this->app['translator'];
$locales = $translator->get('system::lang.locale');
$this->assertNotEmpty($locales);
$locales = array_keys($locales);
$modules = ['system', 'backend', 'cms'];
$files = ['lang.php', 'validation.php', 'client.php'];
foreach ($modules as $module) {
foreach ($locales as $locale) {
foreach ($files as $file) {
$srcPath = base_path() . '/modules/'.$module.'/lang/'.$locale.'/'.$file;
if (!file_exists($srcPath)) continue;
$messages = require $srcPath;
$this->assertNotEmpty($messages);
$this->assertNotCount(0, $messages);
}
}
}
}
}