MINOR Added unit test for DropdownField::performReadonlyTransformation()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84978 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-08-21 04:16:21 +00:00
parent fc372b9598
commit df31edf8b6

View File

@ -24,6 +24,14 @@ class DropdownFieldTest extends SapphireTest {
);
}
function testReadonlyField() {
$dropdownField = new DropdownField('FeelingOk', 'Are you feeling ok?', array(0 => 'No', 1 => 'Yes'), '', null, '(Select one)');
$dropdownField->setValue(1);
$readonlyDropdownField = $dropdownField->performReadonlyTransformation();
preg_match('/Yes/', $dropdownField->Field(), $matches);
$this->assertEquals($matches[0], 'Yes');
}
function testEmptyStringAsBooleanConstructorArgument() {
$source = array(1=>'one');
$field = new DropdownField('Field', null, $source, null, null, true);