[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
This commit is contained in:
Manuel Kiessling 2012-01-17 18:44:55 +01:00
parent 51ecb3c07b
commit a1317c3437

View File

@ -11,12 +11,16 @@
namespace Symfony\Tests\Component\Locale;
use Symfony\Component\Locale\Locale;
require_once __DIR__.'/TestCase.php';
class LocaleTest extends \PHPUnit_Framework_TestCase
use Symfony\Component\Locale\Locale;
use Symfony\Tests\Component\Locale\TestCase as LocaleTestCase;
class LocaleTest extends LocaleTestCase
{
public function testGetDisplayCountriesReturnsFullListForSubLocale()
{
$this->skipIfIntlExtensionIsNotLoaded();
$countriesDe = Locale::getDisplayCountries('de');
$countriesDeCh = Locale::getDisplayCountries('de_CH');
@ -27,6 +31,7 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
public function testGetDisplayLanguagesReturnsFullListForSubLocale()
{
$this->skipIfIntlExtensionIsNotLoaded();
$languagesDe = Locale::getDisplayLanguages('de');
$languagesDeCh = Locale::getDisplayLanguages('de_CH');
@ -37,6 +42,7 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
public function testGetDisplayLocalesReturnsFullListForSubLocale()
{
$this->skipIfIntlExtensionIsNotLoaded();
$localesDe = Locale::getDisplayLocales('de');
$localesDeCh = Locale::getDisplayLocales('de_CH');