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

Commit

Permalink
Merge pull request #4232 from Chintanvpatel/radiofix1
Browse files Browse the repository at this point in the history
Correct tests for group multicheckbox & radio attributes

Conflicts:
	tests/ZendTest/Form/View/Helper/FormMultiCheckboxTest.php
  • Loading branch information
weierophinney committed Apr 15, 2013
2 parents 7289087 + e7547de commit 3bdcfe4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/ZendTest/Form/View/Helper/FormMultiCheckboxTest.php
Expand Up @@ -372,4 +372,40 @@ public function testGetDisableAttributeReturnTrue()
$this->assertSame('true', $element->getAttribute('disabled'));
}

public function testGetSelectedAttributeReturnTrue()
{
$element = new MultiCheckboxElement('foo');
$element->setAttribute('selected', 'true' );
$this->assertSame('true', $element->getAttribute('selected'));
}

public function testGetDisableAttributeForGroupReturnTrue()
{
$element = new MultiCheckboxElement('foo');
$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('#value="value1" checked="checked"#', $markup);

}
}

0 comments on commit 3bdcfe4

Please sign in to comment.