PasswordFieldTest.php 1022 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Tests\Component\Form;
  11. use Symfony\Component\Form\PasswordField;
  12. class PasswordFieldTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function testGetDisplayedData()
  15. {
  16. $field = new PasswordField('name');
  17. $field->setData('before');
  18. $this->assertSame('', $field->getDisplayedData());
  19. $field->submit('after');
  20. $this->assertSame('', $field->getDisplayedData());
  21. }
  22. public function testGetDisplayedDataWithAlwaysEmptyDisabled()
  23. {
  24. $field = new PasswordField('name', array('always_empty' => false));
  25. $field->setData('before');
  26. $this->assertSame('', $field->getDisplayedData());
  27. $field->submit('after');
  28. $this->assertSame('after', $field->getDisplayedData());
  29. }
  30. }