aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/languages
diff options
context:
space:
mode:
Diffstat (limited to 'tests/languages')
-rw-r--r--tests/languages/de/UtilsDeTest.php2
-rw-r--r--tests/languages/fr/LanguagesFrTest.php27
2 files changed, 27 insertions, 2 deletions
diff --git a/tests/languages/de/UtilsDeTest.php b/tests/languages/de/UtilsDeTest.php
index 4569c923..588c9fd6 100644
--- a/tests/languages/de/UtilsDeTest.php
+++ b/tests/languages/de/UtilsDeTest.php
@@ -20,7 +20,7 @@ class UtilsDeTest extends UtilsTest
20 public function testDateFormatNoTime() 20 public function testDateFormatNoTime()
21 { 21 {
22 $date = DateTime::createFromFormat('Ymd_His', '20170101_101112'); 22 $date = DateTime::createFromFormat('Ymd_His', '20170101_101112');
23 $this->assertRegExp('/1\. Januar 2017/', format_date($date, false,true)); 23 $this->assertRegExp('/1\. Januar 2017/', format_date($date, false, true));
24 } 24 }
25 25
26 /** 26 /**
diff --git a/tests/languages/fr/LanguagesFrTest.php b/tests/languages/fr/LanguagesFrTest.php
index 79d05172..38347de1 100644
--- a/tests/languages/fr/LanguagesFrTest.php
+++ b/tests/languages/fr/LanguagesFrTest.php
@@ -3,7 +3,6 @@
3 3
4namespace Shaarli; 4namespace Shaarli;
5 5
6
7use Shaarli\Config\ConfigManager; 6use Shaarli\Config\ConfigManager;
8 7
9/** 8/**
@@ -172,4 +171,30 @@ class LanguagesFrTest extends \PHPUnit_Framework_TestCase
172 $this->assertEquals('voiture', t($txt, $txt, 1, 'test')); 171 $this->assertEquals('voiture', t($txt, $txt, 1, 'test'));
173 $this->assertEquals('Fouille', t('Search', 'Search', 1, 'test')); 172 $this->assertEquals('Fouille', t('Search', 'Search', 1, 'test'));
174 } 173 }
174
175 /**
176 * Test t() with an extension language file coming from the theme in gettext mode
177 */
178 public function testTranslationThemeExtensionGettext()
179 {
180 $this->conf->set('translation.mode', 'gettext');
181 $this->conf->set('raintpl_tpl', 'tests/utils/customtpl/');
182 $this->conf->set('theme', 'dummy');
183 new Languages('en', $this->conf);
184 $txt = 'rooster'; // ignore me poedit
185 $this->assertEquals('coq', t($txt, $txt, 1, 'dummy'));
186 }
187
188 /**
189 * Test t() with an extension language file coming from the theme in PHP mode
190 */
191 public function testTranslationThemeExtensionPhp()
192 {
193 $this->conf->set('translation.mode', 'php');
194 $this->conf->set('raintpl_tpl', 'tests/utils/customtpl/');
195 $this->conf->set('theme', 'dummy');
196 new Languages('en', $this->conf);
197 $txt = 'rooster'; // ignore me poedit
198 $this->assertEquals('coq', t($txt, $txt, 1, 'dummy'));
199 }
175} 200}