[Form] action allows only strings
This commit is contained in:
parent
ba52c62516
commit
e861500ce8
@ -203,6 +203,7 @@ class FormType extends BaseType
|
||||
]);
|
||||
|
||||
$resolver->setAllowedTypes('label_attr', 'array');
|
||||
$resolver->setAllowedTypes('action', 'string');
|
||||
$resolver->setAllowedTypes('upload_max_size_message', ['callable']);
|
||||
$resolver->setAllowedTypes('help', ['string', 'null']);
|
||||
$resolver->setAllowedTypes('help_attr', 'array');
|
||||
|
@ -341,6 +341,12 @@ class FormTypeTest extends BaseTypeTest
|
||||
$this->factory->create(static::TESTED_TYPE, null, ['attr' => '']);
|
||||
}
|
||||
|
||||
public function testActionCannotBeNull()
|
||||
{
|
||||
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
|
||||
$this->factory->create(static::TESTED_TYPE, null, ['action' => null]);
|
||||
}
|
||||
|
||||
public function testNameCanBeEmptyString()
|
||||
{
|
||||
$form = $this->factory->createNamed('', static::TESTED_TYPE);
|
||||
|
Reference in New Issue
Block a user