getErrors() public method

Get all form element errors.
public getErrors ( ) : array
return array
示例#1
0
 public function testAddElements()
 {
     $e = new Element('text', 'username', 'Username');
     $c = new Checkbox('colors', array('Red', 'Green', 'Blue'));
     $r = new Radio('colors', array('Red', 'Green', 'Blue'));
     $s = new Select('colors', array('Red', 'Green', 'Blue'));
     $t = new Textarea('comments');
     $f = new Form('/submit', 'post');
     $f->addElements($e);
     $f->addElements(array($c, $r, $s, $t));
     $this->assertEquals(5, count($f->getElements()));
     $this->assertInstanceOf('Pop\\Form\\Element', $f->getElement('username'));
     $this->assertTrue($f->isValid());
     $this->assertEquals(0, count($f->getErrors()));
 }