3 class LanguageTest extends TestCase
9 * LanguageTest constructor.
11 public function setUp()
14 $this->langs = array_diff(scandir(resource_path('lang')), ['..', '.']);
17 public function test_js_endpoint_for_each_language()
20 $visibleKeys = ['common', 'components', 'entities', 'errors'];
23 foreach ($this->langs as $lang) {
24 setting()->putUser($this->getEditor(), 'language', $lang);
25 $transResp = $this->get('/translations');
26 foreach ($visibleKeys as $key) {
27 $transResp->assertSee($key);
32 public function test_all_lang_files_loadable()
34 $files = array_diff(scandir(resource_path('lang/en')), ['..', '.']);
35 foreach ($this->langs as $lang) {
36 foreach ($files as $file) {
39 $translations = trans(str_replace('.php', '', $file), [], $lang);
40 } catch (\Exception $e) {
43 $this->assertFalse($loadError, "Translation file {$lang}/{$file} failed to load");