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()); }