mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
fc372b9598
commit
df31edf8b6
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user