8000 [Locale][Testing] Fixed breaking tests if 'intl' extension is not ins… · lsmith77/symfony@a1317c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit a1317c3

Browse files
[Locale][Testing] Fixed breaking tests if 'intl' extension is not installed (symfony#3139)
Symfony\Tests\Component\Locale\LocaleTest->testGetDisplayCountriesReturnsFullListForSubLocale() fails with a fatal error if the PHP extension 'intl' is not installed on the system. Added a check which skips the affected tests if the extension is not available. Fixes symfony#3139
1 parent 51ecb3c commit a1317c3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/Symfony/Tests/Component/Locale/LocaleTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@
1111

1212
namespace Symfony\Tests\Component\Locale;
1313

14+
require_once __DIR__.'/TestCase.php';
15+
1416
use Symfony\Component\Locale\Locale;
17+
use Symfony\Tests\Component\Locale\TestCase as LocaleTestCase;
1518

16-
class LocaleTest extends \PHPUnit_Framework_TestCase
19+
class LocaleTest extends LocaleTestCase
1720
{
1821
public function testGetDisplayCountriesReturnsFullListForSubLocale()
1922
{
23+
$this->skipIfIntlExtensionIsNotLoaded();
2024
$countriesDe = Locale::getDisplayCountries('de');
2125
$countriesDeCh = Locale::getDisplayCountries('de_CH');
2226

@@ -27,6 +31,7 @@ public function testGetDisplayCountriesReturnsFullListForSubLocale()
2731

2832
public function testGetDisplayLanguagesReturnsFullListForSubLocale()
2933
{
34+
$this->skipIfIntlExtensionIsNotLoaded();
3035
$languagesDe = Locale::getDisplayLanguages('de');
3136
$languagesDeCh = Locale::getDisplayLanguages('de_CH');
3237

@@ -37,6 +42,7 @@ public function testGetDisplayLanguagesReturnsFullListForSubLocale()
3742

3843
public function testGetDisplayLocalesReturnsFullListForSubLocale()
3944
{
45+
$this->skipIfIntlExtensionIsNotLoaded();
4046
$localesDe = Locale::getDisplayLocales('de');
4147
$localesDeCh = Locale::getDisplayLocales('de_CH');
4248

0 commit comments

Comments
 (0)
0