1
0
mirror of synced 2024-12-13 22:56:04 +03:00

pookey: fixed email validator and added more test cases

This commit is contained in:
pookey 2006-10-02 01:23:23 +00:00
parent 8abb979578
commit 04a3cb9f63
2 changed files with 5 additions and 2 deletions

View File

@ -29,9 +29,9 @@ class Doctrine_Validator_Email {
$domain_literal = "\\x5b($dtext|$quoted_pair)*\\x5d";
$quoted_string = "\\x22($qtext|$quoted_pair)*\\x22";
$domain_ref = $atom;
$sub_domain = "($domain_ref|$domain_literal)";
$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";

View File

@ -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));
}