function testHasErrors() { $form_element = new WactFormElementComponent('my_id'); $form_element->errorclass = 'ErrorClass'; $form_element->errorstyle = 'ErrorStyle'; $form_element->setError(); $this->assertTrue($form_element->hasErrors()); $this->assertEqual($form_element->getAttribute('class'), 'ErrorClass'); $this->assertEqual($form_element->getAttribute('style'), 'ErrorStyle'); }
function renderAttributes() { if ($this->isChecked()) { $this->setAttribute('checked', "checked"); } else { $this->removeAttribute('checked'); } parent::renderAttributes(); }
function renderAttributes() { $value = $this->getValue(); if (!is_null($value)) { $this->setAttribute('value', $value); } else { $this->setAttribute('value', ''); } parent::renderAttributes(); }