Example #1
0
 function testNoOptionsByDefault()
 {
     $input = new T_Form_Radio('myalias', 'mylabel');
     $this->assertSame($input->getOptions(), array());
 }
Example #2
0
 /**
  * Sets the submission as required.
  *
  * @return T_Form_Element  fluent interface
  */
 function setRequired()
 {
     parent::setRequired();
     // if this is definitely required, we want to remove any 'not present'
     // option key from the list of options.
     if ($this->no_input_key) {
         $options = $this->getOptions();
         unset($options[$this->no_input_key]);
         $this->setOptions($options);
     }
     return $this;
 }
Example #3
0
 /**
  * Get the test element.
  *
  * @return T_Form_Text
  */
 function getElement($name, $label)
 {
     $element = new T_Form_Radio($name, $label);
     $element->setOptions(array('test' => '1', 'dave' => 'fred', 'swadg' => 'asdgf'));
     return $element;
 }