pookey: fixed email validator and added more test cases
This commit is contained in:
parent
8abb979578
commit
04a3cb9f63
@ -31,7 +31,7 @@ class Doctrine_Validator_Email {
|
||||
$domain_ref = $atom;
|
||||
$sub_domain = "($domain_ref|$domain_literal)";
|
||||
$word = "($atom|$quoted_string)";
|
||||
$domain = "$sub_domain(\\x2e$sub_domain)*";
|
||||
$domain = "$sub_domain(\\x2e$sub_domain)+";
|
||||
$local_part = "$word(\\x2e$word)*";
|
||||
$addr_spec = "$local_part\\x40$domain";
|
||||
|
||||
|
@ -143,6 +143,9 @@ class Doctrine_ValidatorTestCase extends Doctrine_UnitTestCase {
|
||||
|
||||
$this->assertFalse($validator->validate($email,"address","example@e..",null));
|
||||
|
||||
$this->assertTrue($validator->validate($email,"address","null@pookey.co.uk",null));
|
||||
$this->assertTrue($validator->validate($email,"address","null@pookey.com",null));
|
||||
$this->assertTrue($validator->validate($email,"address","null@users.doctrine.pengus.net",null));
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user