diff --git a/tests/forms/DropdownFieldTest.php b/tests/forms/DropdownFieldTest.php index 74249989f..45ffab61b 100644 --- a/tests/forms/DropdownFieldTest.php +++ b/tests/forms/DropdownFieldTest.php @@ -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);