コード例 #1
0
ファイル: MessageTest.php プロジェクト: alab1001101/zf2
 /**
  * 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));
 }