function testGetHtmlEscapesOptgroupLabel() { $field = new ListField('test'); $field->setOptions(array('opt 1', 'opt 2'), 'Foo & Bar'); $field->setOptions(array('opt 3', 'opt 4'), 'Science & Fiction'); $html = $field->getHtml(); $this->assertContains('<optgroup label="Foo & Bar">', $html); $this->assertContains('<optgroup label="Science & Fiction">', $html); }