LocaleTest.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Tests\Component\Locale;
  11. use Symfony\Component\Locale\Locale;
  12. class LocaleTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function testGetDisplayCountriesReturnsFullListForSubLocale()
  15. {
  16. $countriesDe = Locale::getDisplayCountries('de');
  17. $countriesDeCh = Locale::getDisplayCountries('de_CH');
  18. $this->assertEquals(count($countriesDe), count($countriesDeCh));
  19. $this->assertEquals($countriesDe['BD'], 'Bangladesch');
  20. $this->assertEquals($countriesDeCh['BD'], 'Bangladesh');
  21. }
  22. public function testGetDisplayLanguagesReturnsFullListForSubLocale()
  23. {
  24. $languagesDe = Locale::getDisplayLanguages('de');
  25. $languagesDeCh = Locale::getDisplayLanguages('de_CH');
  26. $this->assertEquals(count($languagesDe), count($languagesDeCh));
  27. $this->assertEquals($languagesDe['be'], 'Weißrussisch');
  28. $this->assertEquals($languagesDeCh['be'], 'Weissrussisch');
  29. }
  30. public function testGetDisplayLocalesReturnsFullListForSubLocale()
  31. {
  32. $localesDe = Locale::getDisplayLocales('de');
  33. $localesDeCh = Locale::getDisplayLocales('de_CH');
  34. $this->assertEquals(count($localesDe), count($localesDeCh));
  35. $this->assertEquals($localesDe['be'], 'Weißrussisch');
  36. $this->assertEquals($localesDeCh['be'], 'Weissrussisch');
  37. }
  38. }