Skip to content

Commit cb22262

Browse files
committed
Fix remaining tests
1 parent 992d17d commit cb22262

8 files changed

+77
-1
lines changed

Tests/Data/Provider/AbstractCurrencyDataProviderTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ abstract class AbstractCurrencyDataProviderTest extends AbstractDataProviderTest
589589
* @var CurrencyDataProvider
590590
*/
591591
protected $dataProvider;
592+
private $defaultLocale;
592593

593594
protected function setUp()
594595
{
@@ -598,6 +599,15 @@ protected function setUp()
598599
$this->getDataDirectory().'/'.Intl::CURRENCY_DIR,
599600
$this->createEntryReader()
600601
);
602+
603+
$this->defaultLocale = \Locale::getDefault();
604+
}
605+
606+
protected function tearDown()
607+
{
608+
parent::tearDown();
609+
610+
\Locale::setDefault($this->defaultLocale);
601611
}
602612

603613
abstract protected function getDataDirectory();

Tests/Data/Provider/AbstractLanguageDataProviderTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest
831831
* @var LanguageDataProvider
832832
*/
833833
protected $dataProvider;
834+
private $defaultLocale;
834835

835836
protected function setUp()
836837
{
@@ -840,6 +841,15 @@ protected function setUp()
840841
$this->getDataDirectory().'/'.Intl::LANGUAGE_DIR,
841842
$this->createEntryReader()
842843
);
844+
845+
$this->defaultLocale = \Locale::getDefault();
846+
}
847+
848+
protected function tearDown()
849+
{
850+
parent::tearDown();
851+
852+
\Locale::setDefault($this->defaultLocale);
843853
}
844854

845855
abstract protected function getDataDirectory();

Tests/Data/Provider/AbstractLocaleDataProviderTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ abstract class AbstractLocaleDataProviderTest extends AbstractDataProviderTest
2323
* @var LocaleDataProvider
2424
*/
2525
protected $dataProvider;
26+
private $defaultLocale;
2627

2728
protected function setUp()
2829
{
@@ -32,6 +33,13 @@ protected function setUp()
3233
$this->getDataDirectory().'/'.Intl::LOCALE_DIR,
3334
$this->createEntryReader()
3435
);
36+
37+
$this->defaultLocale = \Locale::getDefault();
38+
}
39+
40+
protected function tearDown()
41+
{
42+
\Locale::setDefault($this->defaultLocale);
3543
}
3644

3745
abstract protected function getDataDirectory();

Tests/Data/Provider/AbstractRegionDataProviderTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ abstract class AbstractRegionDataProviderTest extends AbstractDataProviderTest
283283
* @var RegionDataProvider
284284
*/
285285
protected $dataProvider;
286+
private $defaultLocale;
286287

287288
protected function setUp()
288289
{
@@ -292,6 +293,15 @@ protected function setUp()
292293
$this->getDataDirectory().'/'.Intl::REGION_DIR,
293294
$this->createEntryReader()
294295
);
296+
297+
$this->defaultLocale = \Locale::getDefault();
298+
}
299+
300+
protected function tearDown()
301+
{
302+
parent::tearDown();
303+
304+
\Locale::setDefault($this->defaultLocale);
295305
}
296306

297307
abstract protected function getDataDirectory();

Tests/Data/Provider/AbstractScriptDataProviderTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest
219219
* @var ScriptDataProvider
220220
*/
221221
protected $dataProvider;
222+
private $defaultLocale;
222223

223224
protected function setUp()
224225
{
@@ -228,6 +229,15 @@ protected function setUp()
228229
$this->getDataDirectory().'/'.Intl::SCRIPT_DIR,
229230
$this->createEntryReader()
230231
);
232+
233+
$this->defaultLocale = \Locale::getDefault();
234+
}
235+
236+
protected function tearDown()
237+
{
238+
parent::tearDown();
239+
240+
\Locale::setDefault($this->defaultLocale);
231241
}
232242

233243
abstract protected function getDataDirectory();

Tests/DateFormatter/AbstractIntlDateFormatterTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,23 @@
2424
*/
2525
abstract class AbstractIntlDateFormatterTest extends TestCase
2626
{
27+
private $defaultLocale;
28+
2729
protected function setUp()
2830
{
31+
parent::setUp();
32+
33+
$this->defaultLocale = \Locale::getDefault();
2934
\Locale::setDefault('en');
3035
}
3136

37+
protected function tearDown()
38+
{
39+
parent::tearDown();
40+
41+
\Locale::setDefault($this->defaultLocale);
42+
}
43+
3244
/**
3345
* When a time zone is not specified, it uses the system default however it returns null in the getter method.
3446
*

Tests/IntlTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@
1616

1717
class IntlTest extends TestCase
1818
{
19+
private $defaultLocale;
20+
21+
protected function setUp()
22+
{
23+
parent::setUp();
24+
25+
$this->defaultLocale = \Locale::getDefault();
26+
}
27+
28+
protected function tearDown()
29+
{
30+
parent::tearDown();
31+
32+
\Locale::setDefault($this->defaultLocale);
33+
}
34+
1935
/**
2036
* @requires extension intl
2137
*/

Tests/NumberFormatter/AbstractNumberFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function formatCurrencyWithDecimalStyleProvider()
3636
{
3737
return [
3838
[100, 'ALL', '100'],
39-
[100, 'BRL', '100.00'],
39+
[100, 'BRL', '100'],
4040
[100, 'CRC', '100'],
4141
[100, 'JPY', '100'],
4242
[100, 'CHF', '100'],

0 commit comments

Comments
 (0)