]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/languages/fr/LanguagesFrTest.php
Optimize and cleanup imports
[github/shaarli/Shaarli.git] / tests / languages / fr / LanguagesFrTest.php
index 79d05172971896c67119513e739ce581f4a86737..b8b7ca3a548358e98946e5d8833b748a40ecf27c 100644 (file)
@@ -3,7 +3,6 @@
 
 namespace Shaarli;
 
-
 use Shaarli\Config\ConfigManager;
 
 /**
@@ -13,7 +12,7 @@ use Shaarli\Config\ConfigManager;
  *
  * @package Shaarli
  */
-class LanguagesFrTest extends \PHPUnit_Framework_TestCase
+class LanguagesFrTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string Config file path (without extension).
@@ -172,4 +171,30 @@ class LanguagesFrTest extends \PHPUnit_Framework_TestCase
         $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'));
+    }
 }