aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LanguagesTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-05-07 19:17:33 +0200
committerArthurHoaro <arthur@hoa.ro>2017-05-07 19:17:33 +0200
commit01e942d44c7194607649817216aeb5d65c6acad6 (patch)
tree15777aa1005251f119e6dd680291147117766b5b /tests/LanguagesTest.php
parentbc22c9a0acb095970e9494cbe8954f0612e05dc0 (diff)
parent8868f3ca461011a8fb6dd9f90b60ed697ab52fc5 (diff)
downloadShaarli-01e942d44c7194607649817216aeb5d65c6acad6.tar.gz
Shaarli-01e942d44c7194607649817216aeb5d65c6acad6.tar.zst
Shaarli-01e942d44c7194607649817216aeb5d65c6acad6.zip
Merge tag 'v0.8.4' into stable
Release v0.8.4
Diffstat (limited to 'tests/LanguagesTest.php')
-rw-r--r--tests/LanguagesTest.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/LanguagesTest.php b/tests/LanguagesTest.php
new file mode 100644
index 00000000..79c136c8
--- /dev/null
+++ b/tests/LanguagesTest.php
@@ -0,0 +1,41 @@
1<?php
2
3require_once 'application/Languages.php';
4
5/**
6 * Class LanguagesTest.
7 */
8class LanguagesTest extends PHPUnit_Framework_TestCase
9{
10 /**
11 * Test t() with a simple non identified value.
12 */
13 public function testTranslateSingleNotID()
14 {
15 $text = 'abcdé 564 fgK';
16 $this->assertEquals($text, t($text));
17 }
18
19 /**
20 * Test t() with a non identified plural form.
21 */
22 public function testTranslatePluralNotID()
23 {
24 $text = '%s sandwich';
25 $nText = '%s sandwiches';
26 $this->assertEquals('0 sandwich', t($text, $nText));
27 $this->assertEquals('1 sandwich', t($text, $nText, 1));
28 $this->assertEquals('2 sandwiches', t($text, $nText, 2));
29 }
30
31 /**
32 * Test t() with a non identified invalid plural form.
33 */
34 public function testTranslatePluralNotIDInvalid()
35 {
36 $text = 'sandwich';
37 $nText = 'sandwiches';
38 $this->assertEquals('sandwich', t($text, $nText, 1));
39 $this->assertEquals('sandwiches', t($text, $nText, 2));
40 }
41}