TimezoneFieldTest.php 1013 B

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. require_once __DIR__.'/TestCase.php';
  12. use Symfony\Component\Form\TimezoneField;
  13. class TimezoneFieldTest extends TestCase
  14. {
  15. public function testTimezonesAreSelectable()
  16. {
  17. $field = $this->factory->create('timezone', 'timezone');
  18. $choices = $field->getRenderer()->getVar('choices');
  19. $this->assertArrayHasKey('Africa', $choices);
  20. $this->assertArrayHasKey('Africa/Kinshasa', $choices['Africa']);
  21. $this->assertEquals('Kinshasa', $choices['Africa']['Africa/Kinshasa']);
  22. $this->assertArrayHasKey('America', $choices);
  23. $this->assertArrayHasKey('America/New_York', $choices['America']);
  24. $this->assertEquals('New York', $choices['America']['America/New_York']);
  25. }
  26. }