Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eb7e9b4

Browse filesBrowse files
committed
[Form] Limit allowed types for 'empty_value' TimeType option
1 parent e141260 commit eb7e9b4
Copy full SHA for eb7e9b4

File tree

2 files changed

+11
-0
lines changed
Filter options

2 files changed

+11
-0
lines changed

‎src/Symfony/Component/Form/Extension/Core/Type/TimeType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/TimeType.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
237237
'hours' => 'array',
238238
'minutes' => 'array',
239239
'seconds' => 'array',
240+
'empty_value' => array('string', 'boolean', 'null'),
240241
));
241242
}
242243

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,4 +730,14 @@ public function testThrowExceptionIfSecondsIsInvalid()
730730
'seconds' => 'bad value',
731731
));
732732
}
733+
734+
/**
735+
* @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
736+
*/
737+
public function testThrowExceptionIfEmptyValueIsInvalid()
738+
{
739+
$this->factory->create('time', null, array(
740+
'empty_value' => array(),
741+
));
742+
}
733743
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.