Files
opensourcepos/tests/LanguageFilesTest.php
objecttothis b7a3fee22a style(lang): add Georgian, normalize quote style across all locales, add parse tests (#4762)
- Normalize all language files to single quotes with aligned => operators;
  no translation text or logic changes
- Add Georgian (ka) scaffolding across ~18 modules with placeholder
  translations, matching project style conventions
- Add LanguageFilesTest to validate every PHP file under app/Language
  parses without syntax errors; new files auto-discovered via glob
2026-10-19 15:21:04 +04:00

39 lines
1.0 KiB
PHP

<?php
namespace Tests;
use CodeIgniter\Test\CIUnitTestCase;
use PHPUnit\Framework\Attributes\DataProvider;
class LanguageFilesTest extends CIUnitTestCase
{
/**
* @return array<string, array{0: string}>
*/
public static function languageFileProvider(): array
{
$cases = [];
$languageRoot = realpath(__DIR__ . '/../app/Language');
foreach (glob($languageRoot . '/*', GLOB_ONLYDIR) as $localeDir) {
foreach (glob($localeDir . '/*.php') as $file) {
$cases[substr($file, strlen($languageRoot) + 1)] = [$file];
}
}
return $cases;
}
#[DataProvider('languageFileProvider')]
public function testLanguageFile_ParsesToArray(string $file): void
{
try {
$result = include $file;
} catch (\ParseError $parseError) {
$this->fail("Failed to parse {$file}: {$parseError->getMessage()}");
}
$this->assertIsArray($result, "{$file} must return an array");
}
}