Beispiel #1
0
 public function testReSetData()
 {
     $form = new Form();
     $form->input('name');
     $form->input('email');
     $form->input('age');
     $form->handle(new FormData('post', [$form->getUid() => '1', 'name' => 'petro', 'email' => '*****@*****.**']));
     $this->assertEquals('*****@*****.**', $form->getElements()['email']->getValue());
     $this->assertEquals(['name' => 'petro', 'email' => '*****@*****.**', 'age' => ''], $form->getData());
     $form->handle(new FormData('post', [$form->getUid() => '1', 'name' => 'stepan']));
     $this->assertEquals(null, $form->getElement('email')->getValue());
     $this->assertEquals('stepan', $form->getElement('name')->getValue());
 }