// A required field without any value has a "none" option.
$this->assertTrue($this->xpath('//select[@id=:id]//option[@value="_none" and text()=:label]',array(':id'=>'edit-card-1-'.$langcode,':label'=>t('- Select a value -'))),t('A required select list has a "Select a value" choice.'));
...
...
@@ -244,7 +244,7 @@ class OptionsWidgetsTestCase extends FieldTestCase {
// A required field with a value has no 'none' option.
$this->assertFalse($this->xpath('//select[@id=:id]//option[@value="_none"]',array(':id'=>'edit-card-1-'.$langcode)),t('A required select list with an actual value has no "none" choice.'));
$this->assertTrue($this->xpath('//select[@id=:id]//option[@value="_none" and text()=:label]',array(':id'=>'edit-card-1-'.$langcode,':label'=>t('- None -'))),t('A non-required select list has a "None" choice.'));
$this->assertFalse($this->xpath('//select[@id=:id]//option[@value=""]',array(':id'=>'edit-card-2-'.$langcode)),t('A required select list does not have an empty key.'));
// We do not have to test that a required select list with one option is
...
...
@@ -388,7 +388,7 @@ class OptionsWidgetsTestCase extends FieldTestCase {
field_update_instance($instance);
// Display form: with no field data, nothing is selected.