/**
  * Explicitly setting value to 0 resulted in value="1"
  * @see http://news.php.net/php.pear.general/31496
  */
 public function testValue0()
 {
     $box = new HTML_QuickForm2_Element_InputCheckbox('testBox', array('value' => 0));
     $this->assertContains('value="0"', $box->__toString());
 }
Example #2
0
 /**
  * returns empty string instead of null, so value is present in Form::getValue()
  */
 function getValue()
 {
     $value = parent::getValue();
     $data = $this->getData();
     $empty_value = isset($data['empty_value']) ? $data['empty_value'] : "";
     return $value == null ? $empty_value : $value;
 }
 public function testDefaultValueAttributeIs1()
 {
     $box = new HTML_QuickForm2_Element_InputCheckbox();
     $this->assertEquals('1', $box->getAttribute('value'));
 }
Example #4
0
 /**
  * returns empty string instead of null, so value is present in Form::getValue()
  */
 function getValue()
 {
     $value = parent::getValue();
     return $value == null ? "" : $value;
 }