-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for FILTER_FLAG_EMAIL_UNICODE via "email:filter_unicode"
- Loading branch information
Showing
3 changed files
with
54 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
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 |
---|---|---|
|
@@ -2353,6 +2353,32 @@ public function testValidateEmailWithFilterCheck() | |
{ | ||
$v = new Validator($this->getIlluminateArrayTranslator(), ['x' => 'foo@bar'], ['x' => 'email:filter']); | ||
$this->assertFalse($v->passes()); | ||
|
||
$v = new Validator($this->getIlluminateArrayTranslator(), ['x' => '[email protected]'], ['x' => 'email:filter']); | ||
$this->assertTrue($v->passes()); | ||
|
||
// Unicode characters are not allowed | ||
$v = new Validator($this->getIlluminateArrayTranslator(), ['x' => 'exä[email protected]'], ['x' => 'email:filter']); | ||
$this->assertFalse($v->passes()); | ||
|
||
$v = new Validator($this->getIlluminateArrayTranslator(), ['x' => 'exämple@exämple.com'], ['x' => 'email:filter']); | ||
$this->assertFalse($v->passes()); | ||
} | ||
|
||
public function testValidateEmailWithFilterUnicodeCheck() | ||
{ | ||
$v = new Validator($this->getIlluminateArrayTranslator(), ['x' => 'foo@bar'], ['x' => 'email:filter_unicode']); | ||
$this->assertFalse($v->passes()); | ||
|
||
$v = new Validator($this->getIlluminateArrayTranslator(), ['x' => '[email protected]'], ['x' => 'email:filter_unicode']); | ||
$this->assertTrue($v->passes()); | ||
|
||
// Any unicode characters are allowed only in local-part | ||
$v = new Validator($this->getIlluminateArrayTranslator(), ['x' => 'exä[email protected]'], ['x' => 'email:filter_unicode']); | ||
$this->assertTrue($v->passes()); | ||
|
||
$v = new Validator($this->getIlluminateArrayTranslator(), ['x' => 'exämple@exämple.com'], ['x' => 'email:filter_unicode']); | ||
$this->assertFalse($v->passes()); | ||
} | ||
|
||
/** | ||
|