a1317c3437
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
54 lines
1.8 KiB
PHP
54 lines
1.8 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Symfony package.
|
|
*
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
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 LocaleTestCase
|
|
{
|
|
public function testGetDisplayCountriesReturnsFullListForSubLocale()
|
|
{
|
|
$this->skipIfIntlExtensionIsNotLoaded();
|
|
$countriesDe = Locale::getDisplayCountries('de');
|
|
$countriesDeCh = Locale::getDisplayCountries('de_CH');
|
|
|
|
$this->assertEquals(count($countriesDe), count($countriesDeCh));
|
|
$this->assertEquals($countriesDe['BD'], 'Bangladesch');
|
|
$this->assertEquals($countriesDeCh['BD'], 'Bangladesh');
|
|
}
|
|
|
|
public function testGetDisplayLanguagesReturnsFullListForSubLocale()
|
|
{
|
|
$this->skipIfIntlExtensionIsNotLoaded();
|
|
$languagesDe = Locale::getDisplayLanguages('de');
|
|
$languagesDeCh = Locale::getDisplayLanguages('de_CH');
|
|
|
|
$this->assertEquals(count($languagesDe), count($languagesDeCh));
|
|
$this->assertEquals($languagesDe['be'], 'Weißrussisch');
|
|
$this->assertEquals($languagesDeCh['be'], 'Weissrussisch');
|
|
}
|
|
|
|
public function testGetDisplayLocalesReturnsFullListForSubLocale()
|
|
{
|
|
$this->skipIfIntlExtensionIsNotLoaded();
|
|
$localesDe = Locale::getDisplayLocales('de');
|
|
$localesDeCh = Locale::getDisplayLocales('de_CH');
|
|
|
|
$this->assertEquals(count($localesDe), count($localesDeCh));
|
|
$this->assertEquals($localesDe['be'], 'Weißrussisch');
|
|
$this->assertEquals($localesDeCh['be'], 'Weissrussisch');
|
|
}
|
|
}
|