mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-28 11:08:53 -04:00
- 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
39 lines
1.0 KiB
PHP
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");
|
|
}
|
|
}
|