Esempio n. 1
0
 public function testDataPopulate()
 {
     $fs = new Fieldset();
     $fs->setName('customers');
     $ele1 = new Element('first_name', 'text');
     $ele2 = new Element('last_name', 'text');
     $ele3 = new Element('address', 'textarea');
     $fs->addElement($ele1);
     $fs->addElement($ele2);
     $fs->addElement($ele3);
     $fs->populateData(['first_name' => 'Sahan', 'last_name' => 'HH']);
     $this->assertEquals('Sahan', $fs->getElement('first_name')->getValue());
     $this->assertEquals('HH', $fs->getElement('last_name')->getValue());
 }