Example #1
0
 public function testBasic()
 {
     $fs = new Fieldset();
     $fs->setName('customers');
     $fs->addElement(new Element('first_name', 'text'));
     $fs->addElement(new Element('last_name', 'text'));
     $fs->addElement(new Element('address', 'textarea'));
     $form = new Form();
     $form->addFieldset($fs);
     $form->setAttribute('action', 'create');
     $form->setAttribute('class', 'form-horizontal');
     $this->assertEquals(['customers' => $fs], $form->getFieldsets());
     $this->assertEquals($form->getAttribute('class'), 'form-horizontal');
     $this->assertEquals($form->getAttribute('action'), 'create');
 }