Skip to content

Commit 53d8008

Browse files
Merge branch '3.4' into 4.3
* 3.4: Fix inconsistent return points. Fix remaining tests
2 parents 822a3af + cb22262 commit 53d8008

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
@@ -591,6 +591,7 @@ abstract class AbstractCurrencyDataProviderTest extends AbstractDataProviderTest
591591
* @var CurrencyDataProvider
592592
*/
593593
protected $dataProvider;
594+
private $defaultLocale;
594595

595596
protected function setUp()
596597
{
@@ -600,6 +601,15 @@ protected function setUp()
600601
$this->getDataDirectory().'/'.Intl::CURRENCY_DIR,
601602
$this->createEntryReader()
602603
);
604+
605+
$this->defaultLocale = \Locale::getDefault();
606+
}
607+
608+
protected function tearDown()
609+
{
610+
parent::tearDown();
611+
612+
\Locale::setDefault($this->defaultLocale);
603613
}
604614

605615
abstract protected function getDataDirectory();

Tests/Data/Provider/AbstractLanguageDataProviderTest.php

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

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

844854
abstract protected function getDataDirectory();

Tests/Data/Provider/AbstractLocaleDataProviderTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ abstract class AbstractLocaleDataProviderTest extends AbstractDataProviderTest
2525
* @var LocaleDataProvider
2626
*/
2727
protected $dataProvider;
28+
private $defaultLocale;
2829

2930
protected function setUp()
3031
{
@@ -34,6 +35,13 @@ protected function setUp()
3435
$this->getDataDirectory().'/'.Intl::LOCALE_DIR,
3536
$this->createEntryReader()
3637
);
38+
39+
$this->defaultLocale = \Locale::getDefault();
40+
}
41+
42+
protected function tearDown()
43+
{
44+
\Locale::setDefault($this->defaultLocale);
3745
}
3846

3947
abstract protected function getDataDirectory();

Tests/Data/Provider/AbstractRegionDataProviderTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ abstract class AbstractRegionDataProviderTest extends AbstractDataProviderTest
279279
* @var RegionDataProvider
280280
*/
281281
protected $dataProvider;
282+
private $defaultLocale;
282283

283284
protected function setUp()
284285
{
@@ -288,6 +289,15 @@ protected function setUp()
288289
$this->getDataDirectory().'/'.Intl::REGION_DIR,
289290
$this->createEntryReader()
290291
);
292+
293+
$this->defaultLocale = \Locale::getDefault();
294+
}
295+
296+
protected function tearDown()
297+
{
298+
parent::tearDown();
299+
300+
\Locale::setDefault($this->defaultLocale);
291301
}
292302

293303
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)