Skip to content

Commit

Permalink
[Form] Update password type trimming to false
Browse files Browse the repository at this point in the history
  • Loading branch information
GeLoLabs committed Nov 16, 2012
1 parent 7bfe13c commit 97f6a1b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions UPGRADE-2.2.md
Expand Up @@ -31,3 +31,7 @@
$accepts = AcceptHeader::fromString($request->headers->get('Accept'))->all();
```

### Form

* The PasswordType is now not trimmed by default.
Expand Up @@ -35,6 +35,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'always_empty' => true,
'trim' => false,
));
}

Expand Down
Expand Up @@ -39,4 +39,13 @@ public function testNotEmptyIfBoundAndNotAlwaysEmpty()

$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);
}
}

0 comments on commit 97f6a1b

Please sign in to comment.