X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Flanguages%2Ffr%2FLanguagesFrTest.php;h=38347de19cce5e543e8774d60b5991a19c6bc8ed;hb=067c2dd8f5f6eb6cc808ddc4bd30aec104caf73d;hp=c05a0f98643c24f7f452a7ddac40c120b5ff7290;hpb=12266213d098a53c5f005b9afcbbe62771fd580c;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/languages/fr/LanguagesFrTest.php b/tests/languages/fr/LanguagesFrTest.php index c05a0f98..38347de1 100644 --- a/tests/languages/fr/LanguagesFrTest.php +++ b/tests/languages/fr/LanguagesFrTest.php @@ -3,7 +3,6 @@ namespace Shaarli; - use Shaarli\Config\ConfigManager; /** @@ -155,7 +154,8 @@ class LanguagesFrTest extends \PHPUnit_Framework_TestCase $this->conf->set('translation.mode', 'gettext'); $this->conf->set('translation.extensions.test', 'tests/utils/languages/'); new Languages('en', $this->conf); - $this->assertEquals('voiture', t('car', 'car', 1, 'test')); + $txt = 'car'; // ignore me poedit + $this->assertEquals('voiture', t($txt, $txt, 1, 'test')); $this->assertEquals('Fouille', t('Search', 'Search', 1, 'test')); } @@ -167,7 +167,34 @@ class LanguagesFrTest extends \PHPUnit_Framework_TestCase $this->conf->set('translation.mode', 'php'); $this->conf->set('translation.extensions.test', 'tests/utils/languages/'); new Languages('en', $this->conf); - $this->assertEquals('voiture', t('car', 'car', 1, 'test')); + $txt = 'car'; // ignore me poedit + $this->assertEquals('voiture', t($txt, $txt, 1, 'test')); $this->assertEquals('Fouille', t('Search', 'Search', 1, 'test')); } + + /** + * Test t() with an extension language file coming from the theme in gettext mode + */ + public function testTranslationThemeExtensionGettext() + { + $this->conf->set('translation.mode', 'gettext'); + $this->conf->set('raintpl_tpl', 'tests/utils/customtpl/'); + $this->conf->set('theme', 'dummy'); + new Languages('en', $this->conf); + $txt = 'rooster'; // ignore me poedit + $this->assertEquals('coq', t($txt, $txt, 1, 'dummy')); + } + + /** + * Test t() with an extension language file coming from the theme in PHP mode + */ + public function testTranslationThemeExtensionPhp() + { + $this->conf->set('translation.mode', 'php'); + $this->conf->set('raintpl_tpl', 'tests/utils/customtpl/'); + $this->conf->set('theme', 'dummy'); + new Languages('en', $this->conf); + $txt = 'rooster'; // ignore me poedit + $this->assertEquals('coq', t($txt, $txt, 1, 'dummy')); + } }