MINOR Added tests for checking extra class was added to DropdownField

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66624 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-11-25 07:18:19 +00:00 committed by Sam Minnee
parent 0af4fb3673
commit 4950fdf0cb

View File

@ -5,6 +5,14 @@
*/
class DropdownFieldTest extends SapphireTest {
function testAddExtraClass() {
/* DropdownField has an extra class name and is in the HTML the field returns */
$dropdownField = new DropdownField('FeelingOk', 'Are you feeling ok?', array(0 => 'No', 1 => 'Yes'), '', null, '(Select one)');
$dropdownField->addExtraClass('thisIsMyExtraClassForDropdownField');
preg_match('/thisIsMyExtraClassForDropdownField/', $dropdownField->Field(), $matches);
$this->assertTrue($matches[0] == 'thisIsMyExtraClassForDropdownField');
}
function testGetSource() {
$source = array(1=>'one');
$field = new DropdownField('Field', null, $source);