* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\Tests\Extension\Core\Type; use Symfony\Component\Form\ChoiceList\View\ChoiceView; class TimezoneTypeTest extends BaseTypeTest { const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\TimezoneType'; public function testTimezonesAreSelectable() { $choices = $this->factory->create(static::TESTED_TYPE) ->createView()->vars['choices']; $this->assertArrayHasKey('Africa', $choices); $this->assertContains(new ChoiceView('Africa/Kinshasa', 'Africa/Kinshasa', 'Kinshasa'), $choices['Africa'], '', false, false); $this->assertArrayHasKey('America', $choices); $this->assertContains(new ChoiceView('America/New_York', 'America/New_York', 'New York'), $choices['America'], '', false, false); } public function testSubmitNull($expected = null, $norm = null, $view = null) { parent::testSubmitNull($expected, $norm, ''); } public function testDateTimeZoneInput() { $form = $this->factory->create(static::TESTED_TYPE, new \DateTimeZone('America/New_York'), array('input' => 'datetimezone')); $this->assertSame('America/New_York', $form->createView()->vars['value']); $form->submit('Europe/Amsterdam'); $this->assertEquals(new \DateTimeZone('Europe/Amsterdam'), $form->getData()); $form = $this->factory->create(static::TESTED_TYPE, array(new \DateTimeZone('America/New_York')), array('input' => 'datetimezone', 'multiple' => true)); $this->assertSame(array('America/New_York'), $form->createView()->vars['value']); $form->submit(array('Europe/Amsterdam', 'Europe/Paris')); $this->assertEquals(array(new \DateTimeZone('Europe/Amsterdam'), new \DateTimeZone('Europe/Paris')), $form->getData()); } public function testFilterByRegions() { $choices = $this->factory->create(static::TESTED_TYPE, null, array('regions' => \DateTimeZone::EUROPE)) ->createView()->vars['choices']; $this->assertContains(new ChoiceView('Europe/Amsterdam', 'Europe/Amsterdam', 'Amsterdam'), $choices, '', false, false); } } __halt_compiler();----SIGNATURE:----NrrtXRfW//pqpCWJTl0I6tE4F2N5WwhgBPSRvAV1hFxBi0AsfvNeBMzAlw+8Vglv3yVeLJWq/QjMZocq4hDX6F678+gUMbs64dfrd+Hoq+LYbEz6aI36FTtByZc3wpML65nSFEIjBthxnDw1jbSvWXbM6HT1qzI0NLkrvWRS0ZyfW5K854eOq2CoFwBN4Tf/N0kCsvTl9wPDnySt3U9jCzTMewPM/GmxzJerW7QrVvm+06uKIrO5EiZhgnfWhz1cHroMNH6DCcfmS/CEawFklgFV5hPn0+0XrTByca4vMwac3RRf56QbVR5kUDmjFzhKbYVkd2pnkUja1wKlIy75id09MltNRVNjvhlDkiOJFxlDc2b5sPu1C5FD4TO8I6dqNw7dR7WPpXl6KBPfgg6Ej3IepQL0eYhZygceEsfQB8LDgq7VNoivcRVDEPWn4nl9umgNQhsfK1sa7VmKc5EN0Lo6omInxkOqHUhBTAawBo5Kuls4HzA1cA4zoEqmmrJtdfp9naKbscvS9btjwTs/lUbP3uzwnUYTZ/qPIM6NN+FTOGqDeq1xVcIit4Z8jerOKQcj1gqtpB4XAf0oaGaySuJSwzplQhRL9InrIO7Z83blEFgXtCHXbvhzBdZeeHofHPS8vSLO5l5ntdRb4NR9J9yy4QA6V4/WYO+xLJDR3vs=----ATTACHMENT:----ODc1NzIwOTcwNTUzOTgyMSA3NDMzMjQ5NDEwMzE0OTEzIDUwODkwODU3MTgxNjM2Njg=