mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-10-22 17:05:50 +02:00
18 lines
776 B
PHP
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());
|
||
|
}
|
||
|
}
|