silverstripe-framework/tests/forms/ConfirmedPasswordFieldTest.php
Sam Minnee 6bcabcbe46 BUGFIX #4306 simon_w: Fixed ConfirmedPasswordField::setValue()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80192 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-27 04:00:10 +00:00

18 lines
776 B
PHP

<?php
/**
* @package sapphire
* @subpackage tests
*/
class ConfirmedPasswordFieldTest extends SapphireTest {
function testSetValue() {
$field = new ConfirmedPasswordField('Test', 'Testing', 'valueA');
$this->assertEquals('valueA', $field->Value());
$this->assertEquals('valueA', $field->children->fieldByName($field->Name() . '[_Password]')->Value());
$this->assertEquals('valueA', $field->children->fieldByName($field->Name() . '[_ConfirmPassword]')->Value());
$field->setValue('valueB');
$this->assertEquals('valueB', $field->Value());
$this->assertEquals('valueB', $field->children->fieldByName($field->Name() . '[_Password]')->Value());
$this->assertEquals('valueB', $field->children->fieldByName($field->Name() . '[_ConfirmPassword]')->Value());
}
}