public function testRemoveAttribReturnsFalseIfAttribDoesNotExist() { $this->assertFalse($this->form->removeAttrib('foo')); }
/** * Adds a captcha element to the given form if the for attribute * "data-captcha" equals true or "yes". * * The "data-captcha" attribute is removed after processing to * ensure that it is not rendered by the form. * * @param Zend_Form $form */ public function enhance(Zend_Form $form) { $activate = $form->getAttrib('data-captcha'); if ($activate === null) { // Form does not define instructions regarding captcha usage. return; } // Remove the attribute to ensure that the instruction is not rendered. $form->removeAttrib('data-captcha'); if ($activate !== 'yes') { return; } $this->addCaptcha($form); }