diff --git a/tests/Zend/Form/Decorator/LabelTest.php b/tests/Zend/Form/Decorator/LabelTest.php old mode 100644 new mode 100755 index 229d898..7f02225 --- a/tests/Zend/Form/Decorator/LabelTest.php +++ b/tests/Zend/Form/Decorator/LabelTest.php @@ -15,7 +15,7 @@ require_once 'Zend/View.php'; /** * Test class for Zend_Form_Decorator_Label */ -class Zend_Form_Decorator_LabelTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_LabelTest extends PHPUnit_Framework_TestCase { /** * Runs the test methods of this class. @@ -270,6 +270,22 @@ class Zend_Form_Decorator_LabelTest extends PHPUnit_Framework_TestCase $content = $this->decorator->render(''); $this->assertTrue(empty($content), $content); } + + + public function testSettingTagOptionsSetsOptionsForHtmlTag() + { + $element = new Zend_Form_Element('foo'); + $element->setView($this->getView()) + ->setLabel('My Label'); + $this->decorator->setElement($element) + ->setOptions(array('tag' => 'div','tagOptions' => array('class' => 'bazbat','id' => 'bar'))); + $content = 'test content'; + $test = $this->decorator->render($content); + + // tagOptions does not override tag,id options passed to htmltag and so id='foo-label' NOT 'bar' + $this->assertContains('div class="bazbat" id="foo-label"', $test); + + } } // Call Zend_Form_Decorator_LabelTest::main() if this source file is executed directly.