[Form] Update password type trimming to false
This commit is contained in:
parent
7bfe13c912
commit
97f6a1b4d9
@ -31,3 +31,7 @@
|
|||||||
$accepts = AcceptHeader::fromString($request->headers->get('Accept'))->all();
|
$accepts = AcceptHeader::fromString($request->headers->get('Accept'))->all();
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Form
|
||||||
|
|
||||||
|
* The PasswordType is now not trimmed by default.
|
||||||
|
@ -35,6 +35,7 @@ class PasswordType extends AbstractType
|
|||||||
{
|
{
|
||||||
$resolver->setDefaults(array(
|
$resolver->setDefaults(array(
|
||||||
'always_empty' => true,
|
'always_empty' => true,
|
||||||
|
'trim' => false,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,4 +39,13 @@ class PasswordTypeTest extends TypeTestCase
|
|||||||
|
|
||||||
$this->assertSame('pAs5w0rd', $view->vars['value']);
|
$this->assertSame('pAs5w0rd', $view->vars['value']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testNotTrimmed()
|
||||||
|
{
|
||||||
|
$form = $this->factory->create('password', null);
|
||||||
|
$form->bind(' pAs5w0rd ');
|
||||||
|
$data = $form->getData();
|
||||||
|
|
||||||
|
$this->assertSame(' pAs5w0rd ', $data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user