/** * Ensures that the getError() function returns an array of * message key values corresponding to the messages. * * @return void */ public function testGetErrors() { $inputInvalid = 'abcdefghij'; $this->assertFalse($this->_validator->isValid($inputInvalid)); $messages = $this->_validator->getMessages(); $this->assertEquals("'{$inputInvalid}' is more than 8 characters long", current($messages)); $errors = $this->_validator->getErrors(); $this->assertEquals(Validator\StringLength::TOO_LONG, current($errors)); }