getErrors() public method

Get form element object errors.
public getErrors ( ) : array
return array
Exemplo n.º 1
0
 public function testValidate()
 {
     $e = new Element('text', 'email');
     $e->addValidator(new Email());
     $e->setValue('*****@*****.**');
     $this->assertTrue($e->validate());
     $e = new Element('text', 'email');
     $e->addValidator(new Email());
     $e->setValue('testtest.com');
     $this->assertFalse($e->validate());
     $this->assertContains('class="error"', $e->render(true));
     $this->assertGreaterThan(0, count($e->getErrors()));
     $this->assertTrue($e->hasErrors());
 }