@@ -20,10 +20,7 @@ protected function setUp()
20
20
{
21
21
parent ::setUp ();
22
22
23
- // Since we test against "de_AT", we need the full implementation
24
- IntlTestHelper::requireFullIntl ($ this );
25
-
26
- \Locale::setDefault ('de_AT ' );
23
+ \Locale::setDefault ('en ' );
27
24
}
28
25
29
26
public function provideTransformations ()
@@ -44,6 +41,9 @@ public function provideTransformations()
44
41
*/
45
42
public function testTransform ($ from , $ to , $ locale )
46
43
{
44
+ // Since we test against other locales, we need the full implementation
45
+ IntlTestHelper::requireFullIntl ($ this );
46
+
47
47
\Locale::setDefault ($ locale );
48
48
49
49
$ transformer = new NumberToLocalizedStringTransformer ();
@@ -67,6 +67,9 @@ public function provideTransformationsWithGrouping()
67
67
*/
68
68
public function testTransformWithGrouping ($ from , $ to , $ locale )
69
69
{
70
+ // Since we test against other locales, we need the full implementation
71
+ IntlTestHelper::requireFullIntl ($ this );
72
+
70
73
\Locale::setDefault ($ locale );
71
74
72
75
$ transformer = new NumberToLocalizedStringTransformer (null , true );
@@ -76,6 +79,11 @@ public function testTransformWithGrouping($from, $to, $locale)
76
79
77
80
public function testTransformWithPrecision ()
78
81
{
82
+ // Since we test against "de_AT", we need the full implementation
83
+ IntlTestHelper::requireFullIntl ($ this );
84
+
85
+ \Locale::setDefault ('de_AT ' );
86
+
79
87
$ transformer = new NumberToLocalizedStringTransformer (2 );
80
88
81
89
$ this ->assertEquals ('1234,50 ' , $ transformer ->transform (1234.5 ));
@@ -84,6 +92,11 @@ public function testTransformWithPrecision()
84
92
85
93
public function testTransformWithRoundingMode ()
86
94
{
95
+ // Since we test against "de_AT", we need the full implementation
96
+ IntlTestHelper::requireFullIntl ($ this );
97
+
98
+ \Locale::setDefault ('de_AT ' );
99
+
87
100
$ transformer = new NumberToLocalizedStringTransformer (null , null , NumberToLocalizedStringTransformer::ROUND_DOWN );
88
101
$ this ->assertEquals ('1234,547 ' , $ transformer ->transform (1234.547 ), '->transform() only applies rounding mode if precision set ' );
89
102
@@ -96,6 +109,9 @@ public function testTransformWithRoundingMode()
96
109
*/
97
110
public function testReverseTransform ($ to , $ from , $ locale )
98
111
{
112
+ // Since we test against other locales, we need the full implementation
113
+ IntlTestHelper::requireFullIntl ($ this );
114
+
99
115
\Locale::setDefault ($ locale );
100
116
101
117
$ transformer = new NumberToLocalizedStringTransformer ();
@@ -108,6 +124,9 @@ public function testReverseTransform($to, $from, $locale)
108
124
*/
109
125
public function testReverseTransformWithGrouping ($ to , $ from , $ locale )
110
126
{
127
+ // Since we test against other locales, we need the full implementation
128
+ IntlTestHelper::requireFullIntl ($ this );
129
+
111
130
\Locale::setDefault ($ locale );
112
131
113
132
$ transformer = new NumberToLocalizedStringTransformer (null , true );
@@ -122,6 +141,9 @@ public function testReverseTransformWithGroupingAndFixedSpaces()
122
141
$ this ->markTestSkipped ('The "mbstring" extension is required for this test. ' );
123
142
}
124
143
144
+ // Since we test against other locales, we need the full implementation
145
+ IntlTestHelper::requireFullIntl ($ this );
146
+
125
147
\Locale::setDefault ('ru ' );
126
148
127
149
$ transformer = new NumberToLocalizedStringTransformer (null , true );
@@ -131,6 +153,11 @@ public function testReverseTransformWithGroupingAndFixedSpaces()
131
153
132
154
public function testReverseTransformWithGroupingButWithoutGroupSeparator ()
133
155
{
156
+ // Since we test against "de_AT", we need the full implementation
157
+ IntlTestHelper::requireFullIntl ($ this );
158
+
159
+ \Locale::setDefault ('de_AT ' );
160
+
134
161
$ transformer = new NumberToLocalizedStringTransformer (null , true );
135
162
136
163
// omit group separator
@@ -140,6 +167,9 @@ public function testReverseTransformWithGroupingButWithoutGroupSeparator()
140
167
141
168
public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsNotDot ()
142
169
{
170
+ // Since we test against other locales, we need the full implementation
171
+ IntlTestHelper::requireFullIntl ($ this );
172
+
143
173
\Locale::setDefault ('fr ' );
144
174
$ transformer = new NumberToLocalizedStringTransformer (null , true );
145
175
@@ -157,6 +187,11 @@ public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsNotDot()
157
187
*/
158
188
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot ()
159
189
{
190
+ // Since we test against "de_AT", we need the full implementation
191
+ IntlTestHelper::requireFullIntl ($ this );
192
+
193
+ \Locale::setDefault ('de_AT ' );
194
+
160
195
$ transformer = new NumberToLocalizedStringTransformer (null , true );
161
196
162
197
$ transformer ->reverseTransform ('1.234.5 ' );
@@ -167,13 +202,21 @@ public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot()
167
202
*/
168
203
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDotWithNoGroupSep ()
169
204
{
205
+ // Since we test against "de_AT", we need the full implementation
206
+ IntlTestHelper::requireFullIntl ($ this );
207
+
208
+ \Locale::setDefault ('de_AT ' );
209
+
170
210
$ transformer = new NumberToLocalizedStringTransformer (null , true );
171
211
172
212
$ transformer ->reverseTransform ('1234.5 ' );
173
213
}
174
214
175
215
public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsDotButNoGroupingUsed ()
176
216
{
217
+ // Since we test against other locales, we need the full implementation
218
+ IntlTestHelper::requireFullIntl ($ this );
219
+
177
220
\Locale::setDefault ('fr ' );
178
221
$ transformer = new NumberToLocalizedStringTransformer ();
179
222
@@ -183,6 +226,9 @@ public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsDotButNoGroupin
183
226
184
227
public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsNotComma ()
185
228
{
229
+ // Since we test against other locales, we need the full implementation
230
+ IntlTestHelper::requireFullIntl ($ this );
231
+
186
232
\Locale::setDefault ('bg ' );
187
233
$ transformer = new NumberToLocalizedStringTransformer (null , true );
188
234
@@ -200,7 +246,6 @@ public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsNotComma()
200
246
*/
201
247
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsComma ()
202
248
{
203
- \Locale::setDefault ('en ' );
204
249
$ transformer = new NumberToLocalizedStringTransformer (null , true );
205
250
206
251
$ transformer ->reverseTransform ('1,234,5 ' );
@@ -211,15 +256,13 @@ public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsComma()
211
256
*/
212
257
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsCommaWithNoGroupSep ()
213
258
{
214
- \Locale::setDefault ('en ' );
215
259
$ transformer = new NumberToLocalizedStringTransformer (null , true );
216
260
217
261
$ transformer ->reverseTransform ('1234,5 ' );
218
262
}
219
263
220
264
public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsCommaButNoGroupingUsed ()
221
265
{
222
- \Locale::setDefault ('en ' );
223
266
$ transformer = new NumberToLocalizedStringTransformer ();
224
267
225
268
$ this ->assertEquals (1234.5 , $ transformer ->reverseTransform ('1234,5 ' ));
@@ -339,6 +382,9 @@ public function testReverseTransformDisallowsCenteredExtraCharactersMultibyte()
339
382
$ this ->markTestSkipped ('The "mbstring" extension is required for this test. ' );
340
383
}
341
384
385
+ // Since we test against other locales, we need the full implementation
386
+ IntlTestHelper::requireFullIntl ($ this );
387
+
342
388
\Locale::setDefault ('ru ' );
343
389
344
390
$ transformer = new NumberToLocalizedStringTransformer (null , true );
@@ -356,6 +402,9 @@ public function testReverseTransformIgnoresTrailingSpacesInExceptionMessage()
356
402
$ this ->markTestSkipped ('The "mbstring" extension is required for this test. ' );
357
403
}
358
404
405
+ // Since we test against other locales, we need the full implementation
406
+ IntlTestHelper::requireFullIntl ($ this );
407
+
359
408
\Locale::setDefault ('ru ' );
360
409
361
410
$ transformer = new NumberToLocalizedStringTransformer (null , true );
@@ -384,6 +433,9 @@ public function testReverseTransformDisallowsTrailingExtraCharactersMultibyte()
384
433
$ this ->markTestSkipped ('The "mbstring" extension is required for this test. ' );
385
434
}
386
435
436
+ // Since we test against other locales, we need the full implementation
437
+ IntlTestHelper::requireFullIntl ($ this );
438
+
387
439
\Locale::setDefault ('ru ' );
388
440
389
441
$ transformer = new NumberToLocalizedStringTransformer (null , true );
0 commit comments