hasErrors() public method

Get if form element object has errors.
public hasErrors ( ) : array
return array
Esempio 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());
 }