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