From a1317c343724296294450169bd6ffa595e18195f Mon Sep 17 00:00:00 2001 From: Manuel Kiessling Date: Tue, 17 Jan 2012 18:44:55 +0100 Subject: [PATCH] [Locale][Testing] Fixed breaking tests if 'intl' extension is not installed (#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 #3139 --- tests/Symfony/Tests/Component/Locale/LocaleTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/Symfony/Tests/Component/Locale/LocaleTest.php b/tests/Symfony/Tests/Component/Locale/LocaleTest.php index a6ab32af0f6b..0155a521ca22 100644 --- a/tests/Symfony/Tests/Component/Locale/LocaleTest.php +++ b/tests/Symfony/Tests/Component/Locale/LocaleTest.php @@ -11,12 +11,16 @@ namespace Symfony\Tests\Component\Locale; +require_once __DIR__.'/TestCase.php'; + use Symfony\Component\Locale\Locale; +use Symfony\Tests\Component\Locale\TestCase as LocaleTestCase; -class LocaleTest extends \PHPUnit_Framework_TestCase +class LocaleTest extends LocaleTestCase { public function testGetDisplayCountriesReturnsFullListForSubLocale() { + $this->skipIfIntlExtensionIsNotLoaded(); $countriesDe = Locale::getDisplayCountries('de'); $countriesDeCh = Locale::getDisplayCountries('de_CH'); @@ -27,6 +31,7 @@ public function testGetDisplayCountriesReturnsFullListForSubLocale() public function testGetDisplayLanguagesReturnsFullListForSubLocale() { + $this->skipIfIntlExtensionIsNotLoaded(); $languagesDe = Locale::getDisplayLanguages('de'); $languagesDeCh = Locale::getDisplayLanguages('de_CH'); @@ -37,6 +42,7 @@ public function testGetDisplayLanguagesReturnsFullListForSubLocale() public function testGetDisplayLocalesReturnsFullListForSubLocale() { + $this->skipIfIntlExtensionIsNotLoaded(); $localesDe = Locale::getDisplayLocales('de'); $localesDeCh = Locale::getDisplayLocales('de_CH');