miniflux-legacy/tests/unit/LocaleTest.php

24 lines
771 B
PHP
Raw Permalink Normal View History

2016-12-29 02:52:58 +01:00
<?php
class LocaleTest extends PHPUnit_Framework_TestCase
{
public function testLocales()
{
foreach (glob('app/Locale/*') as $file) {
$locale = require($file . '/translations.php');
foreach ($locale as $k => $v) {
$this->assertNotEmpty($v, 'Empty value for the key "'.$k.'" in translation '.basename($file));
foreach (array('%s', '%d') as $placeholder) {
$this->assertEquals(
substr_count($k, $placeholder),
substr_count($v, $placeholder),
'Incorrect number of ' . $placeholder . ' in ' . basename($file) .' translation of: ' . $k
);
}
}
}
}
}