/** * @group ZF-4435 */ public function testShouldCreateAppropriateIdsForElementsInSubForms() { $form = new DojoForm(); $form->setDecorators(array('FormElements', array('TabContainer', array('id' => 'tabContainer', 'style' => 'width: 600px; height: 300px;', 'dijitParams' => array('tabPosition' => 'top'))), 'DijitForm')); $sliderForm = new DojoSubForm(); $sliderForm->setAttribs(array('name' => 'slidertab', 'legend' => 'Slider Elements')); $sliderForm->addElement('HorizontalSlider', 'slide1', array('label' => 'Slide me:', 'minimum' => 0, 'maximum' => 25, 'discreteValues' => 10, 'style' => 'width: 450px;', 'topDecorationDijit' => 'HorizontalRuleLabels', 'topDecorationLabels' => array('0%', '50%', '100%'), 'topDecorationParams' => array('style' => 'padding-bottom: 20px;'))); $form->addSubForm($sliderForm, 'slidertab')->setView($this->getView()); $html = $form->render(); $this->assertContains('id="slidertab-slide1-slider"', $html); $this->assertContains('id="slidertab-slide1-slider-topDecoration"', $html); $this->assertContains('id="slidertab-slide1-slider-topDecoration-labels"', $html); }
public function testShouldUseLegendAttribAsTitleIfNoTitlePresent() { $element = new DojoSubForm(); $element->setAttribs(array('name' => 'foo', 'legend' => 'FooBar', 'style' => 'width: 300px; height: 500px;', 'class' => 'someclass'))->setView($this->view); $this->decorator->setElement($element); $html = $this->decorator->render(''); $this->assertContains('FooBar', $html); }