Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Fix type for multicheckbox
Browse files Browse the repository at this point in the history
Fix type for multicheckbox and add unit tests
  • Loading branch information
blanchonvincent committed Aug 30, 2012
1 parent 89eaf41 commit 6ba750f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions library/Zend/Form/Element/MultiCheckbox.php
Expand Up @@ -21,6 +21,15 @@
*/
class MultiCheckbox extends Checkbox
{
/**
* Seed attributes
*
* @var array
*/
protected $attributes = array(
'type' => 'multi_checkbox'
);

/**
* @var bool
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/ZendTest/Form/View/Helper/FormElementTest.php
Expand Up @@ -112,10 +112,13 @@ public function testRendersMultiElementsAsExpected($type, $inputType, $additiona
{
if ($type === 'radio') {
$element = new Element\Radio('foo');
$this->assertEquals('radio', $element->getAttribute('type'));
} elseif ($type === 'multi_checkbox') {
$element = new Element\MultiCheckbox('foo');
$this->assertEquals('multi_checkbox', $element->getAttribute('type'));
} elseif ($type === 'select') {
$element = new Element\Select('foo');
$this->assertEquals('select', $element->getAttribute('type'));
} else {
$element = new Element('foo');
}
Expand Down

0 comments on commit 6ba750f

Please sign in to comment.