Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
added unit test for zendframework/zendframework#5796
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Feb 10, 2014
1 parent 6c9f00b commit 8ba7e60
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/ExplodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace ZendTest\Validator;

use Zend\Validator\Explode;
use Zend\Validator\EmailAddress;

/**
* @group Zend_Validator
Expand Down Expand Up @@ -129,4 +130,25 @@ public function testSetValidatorInvalidParam()
$validator = new Explode();
$validator->setValidator('inarray');
}

/**
* @group ZF2-5796
*/
public function testGetMessageNotChangeType()
{
$validator = new Explode(array(
'validator' => new EmailAddress,
'valueDelimiter' => ',',
'breakOnFirstFailure' => true,
));

$messages = array(
0 => array(
'emailAddressInvalidFormat' => 'The input is not a valid email address. Use the basic format local-part@hostname',
),
);

$this->assertFalse($validator->isValid('zf-devteam@zend.com,abc,defghij'));
$this->assertEquals($messages, $validator->getMessages());
}
}

0 comments on commit 8ba7e60

Please sign in to comment.