LocaleFieldTest.php 817 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace Symfony\Tests\Component\Form;
  3. use Symfony\Component\Form\LocaleField;
  4. use Symfony\Component\Form\FormConfiguration;
  5. class LocaleFieldTest extends \PHPUnit_Framework_TestCase
  6. {
  7. public function testLocalesAreSelectable()
  8. {
  9. FormConfiguration::setDefaultLocale('de_AT');
  10. $field = new LocaleField('language');
  11. $choices = $field->getOtherChoices();
  12. $this->assertArrayHasKey('en', $choices);
  13. $this->assertEquals('Englisch', $choices['en']);
  14. $this->assertArrayHasKey('en_GB', $choices);
  15. $this->assertEquals('Englisch (Vereinigtes Königreich)', $choices['en_GB']);
  16. $this->assertArrayHasKey('zh_Hans_MO', $choices);
  17. $this->assertEquals('Chinesisch (vereinfacht, Sonderverwaltungszone Macao)', $choices['zh_Hans_MO']);
  18. }
  19. }