TimezoneFieldTest.php 961 B

12345678910111213141516171819202122232425262728293031
  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\TimezoneField;
  12. class TimezoneFieldTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function testTimezonesAreSelectable()
  15. {
  16. $field = new TimeZoneField('timezone');
  17. $choices = $field->getOtherChoices();
  18. $this->assertArrayHasKey('Africa', $choices);
  19. $this->assertArrayHasKey('Africa/Kinshasa', $choices['Africa']);
  20. $this->assertEquals('Kinshasa', $choices['Africa']['Africa/Kinshasa']);
  21. $this->assertArrayHasKey('America', $choices);
  22. $this->assertArrayHasKey('America/New_York', $choices['America']);
  23. $this->assertEquals('New York', $choices['America']['America/New_York']);
  24. }
  25. }