forked from zendframework/zendframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ | |
namespace ZendTest\Validator; | ||
|
||
use Zend\Validator\Explode; | ||
use Zend\Validator\EmailAddress; | ||
use Zend\Validator\Regex; | ||
|
||
/** | ||
* @group Zend_Validator | ||
|
@@ -129,4 +131,27 @@ public function testSetValidatorInvalidParam() | |
$validator = new Explode(); | ||
$validator->setValidator('inarray'); | ||
} | ||
|
||
/** | ||
* @group ZF2-5796 | ||
*/ | ||
public function testGetMessagesMultipleInvalid() | ||
{ | ||
$validator = new Explode(array( | ||
'validator' => new Regex( | ||
'/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/' | ||
), | ||
'valueDelimiter' => ',', | ||
'breakOnFirstFailure' => false, | ||
)); | ||
|
||
$messages = array( | ||
0 => array( | ||
'regexNotMatch' => "The input does not match against pattern '/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/'", | ||
), | ||
); | ||
|
||
$this->assertFalse($validator->isValid('[email protected],abc,defghij')); | ||
$this->assertEquals($messages, $validator->getMessages()); | ||
} | ||
} |