Skip to content

Commit f6ec04c

Browse files
Merge branch '4.3' into 4.4
* 4.3: Fix inconsistent return points. pass translation parameters to the trans filter [Mime] fixed wrong mimetype [ProxyManagerBridge] Polyfill for unmaintained version [HttpClient] Declare `$active` first to prevent weird issue Remove deprecated assertContains [HttpClient] fix tests SCA: dropped unused mocks, duplicate import and a function alias usage Added correct plural for box -> boxes [Config] fix test Fix remaining tests Improve fa (persian) translation
2 parents d959786 + 53d8008 commit f6ec04c

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
@@ -829,6 +829,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest
829829
* @var LanguageDataProvider
830830
*/
831831
protected $dataProvider;
832+
private $defaultLocale;
832833

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

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