|
|
@@ -384,25 +384,26 @@ class Zend_View_Helper_FormRadioTest extends PHPUnit_Framework_TestCase
|
|
|
$this->assertNotContains('style="white-space: nowrap;"', $html);
|
|
|
}
|
|
|
|
|
|
- public function testRadioLabelContainsForAttributeTag()
|
|
|
+ /**
|
|
|
+ * @group ZF-8709
|
|
|
+ */
|
|
|
+ public function testRadioLabelContainsNotForAttributeTag()
|
|
|
{
|
|
|
- $options = array(
|
|
|
- 'foo bar' => 'Foo',
|
|
|
- 'bar baz' => 'Bar',
|
|
|
- 'baz' => 'Baz'
|
|
|
+ $actual = $this->helper->formRadio(
|
|
|
+ array(
|
|
|
+ 'name' => 'foo',
|
|
|
+ 'options' => array(
|
|
|
+ 'bar' => 'Bar',
|
|
|
+ 'baz' => 'Baz'
|
|
|
+ ),
|
|
|
+ )
|
|
|
);
|
|
|
- $html = $this->helper->formRadio(array(
|
|
|
- 'name' => 'foo[bar]',
|
|
|
- 'value' => 'bar',
|
|
|
- 'options' => $options,
|
|
|
- ));
|
|
|
|
|
|
- require_once 'Zend/Filter/Alnum.php';
|
|
|
- $filter = new Zend_Filter_Alnum();
|
|
|
- foreach ($options as $key => $value) {
|
|
|
- $id = 'foo-bar-' . $filter->filter($key);
|
|
|
- $this->assertRegexp('/<label([^>]*)(for="' . $id . '")/', $html);
|
|
|
- }
|
|
|
+ $expected = '<label><input type="radio" name="foo" id="foo-bar" value="bar">Bar</label><br />'
|
|
|
+ . "\n"
|
|
|
+ . '<label><input type="radio" name="foo" id="foo-baz" value="baz">Baz</label>';
|
|
|
+
|
|
|
+ $this->assertSame($expected, $actual);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -422,7 +423,6 @@ class Zend_View_Helper_FormRadioTest extends PHPUnit_Framework_TestCase
|
|
|
$html = $formRadio->formRadio($name, -1, null, $options);
|
|
|
foreach ( $options as $key=>$value ) {
|
|
|
$fid = "{$name}-{$key}";
|
|
|
- $this->assertRegExp('/<label([^>]*)(for="'.$fid.'")/', $html);
|
|
|
$this->assertRegExp('/<input([^>]*)(id="'.$fid.'")/', $html);
|
|
|
}
|
|
|
|