1 | <?php |
||
34 | class LocalizeModuleTest extends \PHPUnit_Framework_TestCase |
||
35 | { |
||
36 | |||
37 | public static $resourceFolder = "resources"; |
||
38 | private $localeEn = [ |
||
39 | "app" => "Test App", |
||
40 | "data" => [ |
||
41 | "name" => "Name", |
||
42 | "user" => "User", |
||
43 | "password" => "Password", |
||
44 | ] |
||
45 | ]; |
||
46 | private $localeEs = [ |
||
47 | "app" => "Test de aplicación", |
||
48 | "data" => [ |
||
49 | "name" => "Nombre", |
||
50 | "user" => "Usuario", |
||
51 | "password" => "Contraseña" |
||
52 | ] |
||
53 | ]; |
||
54 | private $localeFr = [ |
||
55 | "app" => "Test d'application", |
||
56 | "data" => [ |
||
57 | "name" => "Nom", |
||
58 | "user" => "Utilisateur", |
||
59 | "password" => "Mot de passe" |
||
60 | ] |
||
61 | ]; |
||
62 | private $config = [ |
||
63 | ]; |
||
64 | private $valuesXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> |
||
65 | <resources> |
||
66 | <values lang='en'> |
||
67 | <string name='app'>Test App</string> |
||
68 | <array name='data'> |
||
69 | <string name='name'>Name</string> |
||
70 | <string name='user'>User</string> |
||
71 | <string name='password'>Password</string> |
||
72 | </array> |
||
73 | </values> |
||
74 | <values lang='es'> |
||
75 | <string name='app'>Test de aplicación</string> |
||
76 | <array name='data'> |
||
77 | <string name='name'>Nombre</string> |
||
78 | <string name='user'>Usuario</string> |
||
79 | <string name='password'>Contraseña</string> |
||
80 | </array> |
||
81 | </values> |
||
82 | <values lang='fr'> |
||
83 | <string name='app'>Test d'application</string> |
||
84 | <array name='data'> |
||
85 | <string name='name'>Nom</string> |
||
86 | <string name='user'>Utilisateur</string> |
||
87 | <string name='password'>Mot de passe</string> |
||
88 | </array> |
||
89 | </values> |
||
90 | </resources>"; |
||
91 | private $module; |
||
92 | |||
93 | public function setUp() { |
||
118 | |||
119 | public function tearDown() { |
||
132 | |||
133 | /** |
||
134 | * @test |
||
135 | * @expectedException \Tight\Exception\ModuleException |
||
136 | */ |
||
137 | public function testModuleExceptionDirectoryNotFound() { |
||
142 | |||
143 | /** |
||
144 | * @test |
||
145 | * @expectedException \Tight\Exception\ModuleException |
||
146 | */ |
||
147 | public function testModuleExceptionInvalidLocale() { |
||
155 | |||
156 | /** |
||
157 | * @test |
||
158 | */ |
||
159 | public function testGetConfig() { |
||
163 | |||
164 | /** |
||
165 | * @test |
||
166 | * @expectedException \InvalidArgumentException |
||
167 | */ |
||
168 | public function testInvalidArgumentException() { |
||
172 | |||
173 | /** |
||
174 | * @test |
||
175 | */ |
||
176 | public function testJsonGetValues() { |
||
180 | |||
181 | /** |
||
182 | * @test |
||
183 | */ |
||
184 | public function testJsonGetLocales() { |
||
188 | |||
189 | /** |
||
190 | * @test |
||
191 | * @depends testJsonGetValues |
||
192 | * @covers \Tight\Modules\Localize\Localize::setLocale |
||
193 | */ |
||
194 | public function testJsonSetLocale() { |
||
199 | |||
200 | /** |
||
201 | * @test |
||
202 | * @depends testJsonSetLocale |
||
203 | */ |
||
204 | public function testJsonGet() { |
||
216 | |||
217 | /** |
||
218 | * @test |
||
219 | */ |
||
220 | public function testSetResourceFileType() { |
||
224 | |||
225 | /** |
||
226 | * @test |
||
227 | * @depends testSetResourceFileType |
||
228 | */ |
||
229 | public function testXmlGetValues() { |
||
233 | |||
234 | } |
||
235 |