LocaleFieldTest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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\Form;
  11. use Symfony\Component\Form\LocaleField;
  12. use Symfony\Component\Form\FormContext;
  13. class LocaleFieldTest extends \PHPUnit_Framework_TestCase
  14. {
  15. public function testLocalesAreSelectable()
  16. {
  17. \Locale::setDefault('de_AT');
  18. $field = new LocaleField('language');
  19. $choices = $field->getOtherChoices();
  20. $this->assertArrayHasKey('en', $choices);
  21. $this->assertEquals('Englisch', $choices['en']);
  22. $this->assertArrayHasKey('en_GB', $choices);
  23. $this->assertEquals('Englisch (Vereinigtes Königreich)', $choices['en_GB']);
  24. $this->assertArrayHasKey('zh_Hans_MO', $choices);
  25. $this->assertEquals('Chinesisch (vereinfacht, Sonderverwaltungszone Macao)', $choices['zh_Hans_MO']);
  26. }
  27. }