Exemple #1
0
 /**
  * @group ZF-7552
  */
 public function testAddDecoratorsKeepsNonNumericKeyNames()
 {
     $this->form->addDecorators(array(array(array('td' => 'HtmlTag'), array('tag' => 'td')), array(array('tr' => 'HtmlTag'), array('tag' => 'tr')), array('HtmlTag', array('tag' => 'baz'))));
     $t1 = $this->form->getDecorators();
     $this->form->setDecorators($t1);
     $t2 = $this->form->getDecorators();
     $this->assertEquals($t1, $t2);
 }
Exemple #2
0
 public function testRetrievingNamedDecoratorShouldNotReorderDecorators()
 {
     $this->form->setDecorators(array('FormElements', array(array('div' => 'HtmlTag'), array('tag' => 'div')), array(array('fieldset' => 'HtmlTag'), array('tag' => 'fieldset')), 'Form'));
     $decorator = $this->form->getDecorator('fieldset');
     $decorators = $this->form->getDecorators();
     $i = 0;
     $order = array();
     foreach (array_keys($decorators) as $name) {
         $order[$name] = $i;
         ++$i;
     }
     $this->assertEquals(2, $order['fieldset'], var_export($order, 1));
 }
 public function testCanDisableRegisteringFormDecoratorsDuringInitialization()
 {
     $form = new Zend_Form(array('disableLoadDefaultDecorators' => true));
     $decorators = $form->getDecorators();
     $this->assertEquals(array(), $decorators);
 }