--- RadioTest.php (24593) +++ RadioTest.php (working copy) @@ -181,7 +181,9 @@ $element = $form->getElement('foo'); - $this->assertType('My_Decorator_Label', $element->getDecorator('Label')); + $this->assertTrue( + $element->getDecorator('Label') instanceof My_Decorator_Label + ); } /** @@ -199,6 +201,45 @@ } /** + * @group ZF-11517 + */ + public function testCreationWithIndividualDecoratorsAsConstructorOptionsWithoutLabel() + { + $element = new Zend_Form_Element_Radio(array( + 'name' => 'foo', + 'multiOptions' => array( + 'bar' => 'Bar', + 'baz' => 'Baz', + ), + 'decorators' => array( + 'ViewHelper', + ), + )); + + $this->assertFalse($element->getDecorator('label')); + } + + /** + * @group ZF-11517 + */ + public function testRenderingWithIndividualDecoratorsAsConstructorOptionsWithoutLabel() + { + $element = new Zend_Form_Element_Radio(array( + 'name' => 'foo', + 'multiOptions' => array( + 'bar' => 'Bar', + 'baz' => 'Baz', + ), + 'decorators' => array( + 'ViewHelper', + ), + )); + + $html = $element->render($this->getView()); + $this->assertNotContains('
 
', $html); + } + + /** * Used by test methods susceptible to ZF-2794, marks a test as incomplete * * @link http://framework.zend.com/issues/browse/ZF-2794