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

Commit

Permalink
Correct tests for group checkbox & radio attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Chintanvpatel committed Apr 15, 2013
1 parent b003a07 commit e7547de
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions tests/ZendTest/Form/View/Helper/FormMultiCheckboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,34 @@ public function testGetUncheckedValueSetToFoo()
$this->assertSame('foo', $uncheckedValue);
}

public function testGetDisableAttributeReturnTrue()
public function testGetDisableAttributeForGroupReturnTrue()
{
$element = new MultiCheckboxElement('foo');
$element->setAttribute('disabled', 'true' );
$this->assertSame('true', $element->getAttribute('disabled'));
$element->setAttribute('disabled', 'true' );
$element->setValueOptions(array(
array(
'label' => 'label1',
'value' => 'value1',
),
));
$markup = $this->helper->render($element);
$this->assertRegexp('#disabled="disabled" value="value1"#', $markup);

}

public function testGetSelectedAttributeForGroupReturnTrue()
{
$element = new MultiCheckboxElement('foo');
$element->setAttribute('selected', 'true' );
$element->setValueOptions(array(
array(
'label' => 'label1',
'value' => 'value1',
),
));
$markup = $this->helper->render($element);
$this->assertRegexp('#selected="selected" value="value1"#', $markup);

}

}

0 comments on commit e7547de

Please sign in to comment.