@@ -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 testTransformWithScale ()
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 testTransformWithScale()
84
92
85
93
public function transformWithRoundingProvider ()
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
return array (
88
101
// towards positive infinity (1.6 -> 2, -1.6 -> -1)
89
102
array (0 , 1234.5 , '1235 ' , NumberToLocalizedStringTransformer::ROUND_CEILING ),
@@ -183,6 +196,11 @@ public function testTransformWithRounding($scale, $input, $output, $roundingMode
183
196
184
197
public function testTransformDoesNotRoundIfNoScale ()
185
198
{
199
+ // Since we test against "de_AT", we need the full implementation
200
+ IntlTestHelper::requireFullIntl ($ this );
201
+
202
+ \Locale::setDefault ('de_AT ' );
203
+
186
204
$ transformer = new NumberToLocalizedStringTransformer (null , null , NumberToLocalizedStringTransformer::ROUND_DOWN );
187
205
188
206
$ this ->assertEquals ('1234,547 ' , $ transformer ->transform (1234.547 ));
@@ -193,6 +211,9 @@ public function testTransformDoesNotRoundIfNoScale()
193
211
*/
194
212
public function testReverseTransform ($ to , $ from , $ locale )
195
213
{
214
+ // Since we test against other locales, we need the full implementation
215
+ IntlTestHelper::requireFullIntl ($ this );
216
+
196
217
\Locale::setDefault ($ locale );
197
218
198
219
$ transformer = new NumberToLocalizedStringTransformer ();
@@ -205,6 +226,9 @@ public function testReverseTransform($to, $from, $locale)
205
226
*/
206
227
public function testReverseTransformWithGrouping ($ to , $ from , $ locale )
207
228
{
229
+ // Since we test against other locales, we need the full implementation
230
+ IntlTestHelper::requireFullIntl ($ this );
231
+
208
232
\Locale::setDefault ($ locale );
209
233
210
234
$ transformer = new NumberToLocalizedStringTransformer (null , true );
@@ -219,6 +243,9 @@ public function testReverseTransformWithGroupingAndFixedSpaces()
219
243
$ this ->markTestSkipped ('The "mbstring" extension is required for this test. ' );
220
244
}
221
245
246
+ // Since we test against other locales, we need the full implementation
247
+ IntlTestHelper::requireFullIntl ($ this );
248
+
222
249
\Locale::setDefault ('ru ' );
223
250
224
251
$ transformer = new NumberToLocalizedStringTransformer (null , true );
@@ -228,6 +255,11 @@ public function testReverseTransformWithGroupingAndFixedSpaces()
228
255
229
256
public function testReverseTransformWithGroupingButWithoutGroupSeparator ()
230
257
{
258
+ // Since we test against "de_AT", we need the full implementation
259
+ IntlTestHelper::requireFullIntl ($ this );
260
+
261
+ \Locale::setDefault ('de_AT ' );
262
+
231
263
$ transformer = new NumberToLocalizedStringTransformer (null , true );
232
264
233
265
// omit group separator
@@ -343,6 +375,9 @@ public function testReverseTransformDoesNotRoundIfNoScale()
343
375
344
376
public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsNotDot ()
345
377
{
378
+ // Since we test against other locales, we need the full implementation
379
+ IntlTestHelper::requireFullIntl ($ this );
380
+
346
381
\Locale::setDefault ('fr ' );
347
382
$ transformer = new NumberToLocalizedStringTransformer (null , true );
348
383
@@ -360,6 +395,11 @@ public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsNotDot()
360
395
*/
361
396
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot ()
362
397
{
398
+ // Since we test against "de_AT", we need the full implementation
399
+ IntlTestHelper::requireFullIntl ($ this );
400
+
401
+ \Locale::setDefault ('de_AT ' );
402
+
363
403
$ transformer = new NumberToLocalizedStringTransformer (null , true );
364
404
365
405
$ transformer ->reverseTransform ('1.234.5 ' );
@@ -370,13 +410,21 @@ public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot()
370
410
*/
371
411
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDotWithNoGroupSep ()
372
412
{
413
+ // Since we test against "de_AT", we need the full implementation
414
+ IntlTestHelper::requireFullIntl ($ this );
415
+
416
+ \Locale::setDefault ('de_AT ' );
417
+
373
418
$ transformer = new NumberToLocalizedStringTransformer (null , true );
374
419
375
420
$ transformer ->reverseTransform ('1234.5 ' );
376
421
}
377
422
378
423
public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsDotButNoGroupingUsed ()
379
424
{
425
+ // Since we test against other locales, we need the full implementation
426
+ IntlTestHelper::requireFullIntl ($ this );
427
+
380
428
\Locale::setDefault ('fr ' );
381
429
$ transformer = new NumberToLocalizedStringTransformer ();
382
430
@@ -386,6 +434,9 @@ public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsDotButNoGroupin
386
434
387
435
public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsNotComma ()
388
436
{
437
+ // Since we test against other locales, we need the full implementation
438
+ IntlTestHelper::requireFullIntl ($ this );
439
+
389
440
\Locale::setDefault ('bg ' );
390
441
$ transformer = new NumberToLocalizedStringTransformer (null , true );
391
442
@@ -403,7 +454,6 @@ public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsNotComma()
403
454
*/
404
455
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsComma ()
405
456
{
406
- \Locale::setDefault ('en ' );
407
457
$ transformer = new NumberToLocalizedStringTransformer (null , true );
408
458
409
459
$ transformer ->reverseTransform ('1,234,5 ' );
@@ -414,15 +464,13 @@ public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsComma()
414
464
*/
415
465
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsCommaWithNoGroupSep ()
416
466
{
417
- \Locale::setDefault ('en ' );
418
467
$ transformer = new NumberToLocalizedStringTransformer (null , true );
419
468
420
469
$ transformer ->reverseTransform ('1234,5 ' );
421
470
}
422
471
423
472
public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsCommaButNoGroupingUsed ()
424
473
{
425
- \Locale::setDefault ('en ' );
426
474
$ transformer = new NumberToLocalizedStringTransformer ();
427
475
428
476
$ this ->assertEquals (1234.5 , $ transformer ->reverseTransform ('1234,5 ' ));
@@ -542,6 +590,9 @@ public function testReverseTransformDisallowsCenteredExtraCharactersMultibyte()
542
590
$ this ->markTestSkipped ('The "mbstring" extension is required for this test. ' );
543
591
}
544
592
593
+ // Since we test against other locales, we need the full implementation
594
+ IntlTestHelper::requireFullIntl ($ this );
595
+
545
596
\Locale::setDefault ('ru ' );
546
597
547
598
$ transformer = new NumberToLocalizedStringTransformer (null , true );
@@ -559,6 +610,9 @@ public function testReverseTransformIgnoresTrailingSpacesInExceptionMessage()
559
610
$ this ->markTestSkipped ('The "mbstring" extension is required for this test. ' );
560
611
}
561
612
613
+ // Since we test against other locales, we need the full implementation
614
+ IntlTestHelper::requireFullIntl ($ this );
615
+
562
616
\Locale::setDefault ('ru ' );
563
617
564
618
$ transformer = new NumberToLocalizedStringTransformer (null , true );
@@ -587,6 +641,9 @@ public function testReverseTransformDisallowsTrailingExtraCharactersMultibyte()
587
641
$ this ->markTestSkipped ('The "mbstring" extension is required for this test. ' );
588
642
}
589
643
644
+ // Since we test against other locales, we need the full implementation
645
+ IntlTestHelper::requireFullIntl ($ this );
646
+
590
647
\Locale::setDefault ('ru ' );
591
648
592
649
$ transformer = new NumberToLocalizedStringTransformer (null , true );
0 commit comments