feat: Dynamically add all languages to db

Add unit test to find missing translations
This commit is contained in:
Attila Kerekes
2022-11-14 17:51:43 +01:00
committed by Attila Jozsef Kerekes
parent 99193a578e
commit edb51e56f1
12 changed files with 135 additions and 52 deletions

View File

@@ -0,0 +1,23 @@
<?php
namespace Tests\Unit\database\seeders;
use Database\Seeders\SettingsSeeder;
use Tests\TestCase;
class SettingsSeederTest extends TestCase
{
/**
* All language keys are defined in all languages based on the en language file.
*
* @return void
*/
public function testReturnsAJSONMapWithSameAmountOfItemsAsLanguageDirectoriesPresent()
{
$languageDirectories = array_filter(glob(resource_path().'/lang/*'), 'is_dir');
$languageMap = json_decode(SettingsSeeder::getSupportedLanguageMap(), true);
$this->assertTrue(count($languageMap) === count($languageDirectories));
}
}