mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-01 04:29:53 +09:00
feat: Dynamically add all languages to db
Add unit test to find missing translations
This commit is contained in:
committed by
Attila Jozsef Kerekes
parent
99193a578e
commit
edb51e56f1
23
tests/Unit/database/seeders/SettingsSeederTest.php
Normal file
23
tests/Unit/database/seeders/SettingsSeederTest.php
Normal 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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user