aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/languages/de/UtilsDeTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/languages/de/UtilsDeTest.php')
-rw-r--r--tests/languages/de/UtilsDeTest.php76
1 files changed, 76 insertions, 0 deletions
diff --git a/tests/languages/de/UtilsDeTest.php b/tests/languages/de/UtilsDeTest.php
index 8a740389..545fa572 100644
--- a/tests/languages/de/UtilsDeTest.php
+++ b/tests/languages/de/UtilsDeTest.php
@@ -22,4 +22,80 @@ class UtilsDeTest extends UtilsTest
22 $date = DateTime::createFromFormat('Ymd_His', '20170101_101112'); 22 $date = DateTime::createFromFormat('Ymd_His', '20170101_101112');
23 $this->assertEquals('So 01 Jan 2017 10:11:12 EAT', format_date($date, false)); 23 $this->assertEquals('So 01 Jan 2017 10:11:12 EAT', format_date($date, false));
24 } 24 }
25
26 /**
27 * Test autoLocale with a simple value
28 */
29 public function testAutoLocaleValid()
30 {
31 $current = setlocale(LC_ALL, 0);
32 $header = 'en-us';
33 autoLocale($header);
34 $this->assertEquals('en_US.utf8', setlocale(LC_ALL, 0));
35
36 setlocale(LC_ALL, $current);
37 }
38
39 /**
40 * Test autoLocale with an alternative locale value
41 */
42 public function testAutoLocaleValidAlternative()
43 {
44 $current = setlocale(LC_ALL, 0);
45 $header = 'en_us.UTF8';
46 autoLocale($header);
47 $this->assertEquals('en_US.utf8', setlocale(LC_ALL, 0));
48
49 setlocale(LC_ALL, $current);
50 }
51
52 /**
53 * Test autoLocale with multiples value, the first one is valid
54 */
55 public function testAutoLocaleMultipleFirstValid()
56 {
57 $current = setlocale(LC_ALL, 0);
58 $header = 'en-us,de-de';
59 autoLocale($header);
60 $this->assertEquals('en_US.utf8', setlocale(LC_ALL, 0));
61
62 setlocale(LC_ALL, $current);
63 }
64
65 /**
66 * Test autoLocale with multiples value, the second one is valid
67 */
68 public function testAutoLocaleMultipleSecondValid()
69 {
70 $current = setlocale(LC_ALL, 0);
71 $header = 'pt_BR,fr-fr';
72 autoLocale($header);
73 $this->assertEquals('fr_FR.utf8', setlocale(LC_ALL, 0));
74
75 setlocale(LC_ALL, $current);
76 }
77
78 /**
79 * Test autoLocale without value: defaults to en_US.
80 */
81 public function testAutoLocaleBlank()
82 {
83 $current = setlocale(LC_ALL, 0);
84 autoLocale('');
85 $this->assertEquals('en_US.utf8', setlocale(LC_ALL, 0));
86
87 setlocale(LC_ALL, $current);
88 }
89
90 /**
91 * Test autoLocale with an invalid value: defaults to en_US.
92 */
93 public function testAutoLocaleInvalid()
94 {
95 $current = setlocale(LC_ALL, 0);
96 autoLocale('pt_BR');
97 $this->assertEquals('en_US.utf8', setlocale(LC_ALL, 0));
98
99 setlocale(LC_ALL, $current);
100 }
25} 101}