-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] Mail: allow domains as domain.edu.co #4905
Merged
+23
−20
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
eb67acc
[Fix} Mail: allow domains as domain.edu.co
infograf768 b7621c2
domain without .xx should not validate
infograf768 921aead
reverting checking for dot + changing test to true
infograf768 85a35a9
changed one condition to let the tests pass, splited one test in two …
rdeutz 2d33d95
Merge pull request #12 from rdeutz/infograf768/maildoubledot
infograf768 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -17,32 +17,33 @@ | |
class JFormRuleEmailTest extends TestCase | ||
{ | ||
/** | ||
* Test the JFormRuleEmail::test method. | ||
* Test if a valid EMail is accepted by the JFormRuleEmail::test method. | ||
* | ||
* @return void | ||
*/ | ||
public function testEmail() | ||
public function testValidEmail() | ||
{ | ||
$rule = new JFormRuleEmail; | ||
$xml = simplexml_load_string('<form><field name="email1" /><field name="email2" unique="true" /></form>'); | ||
|
||
// Test fail conditions. | ||
|
||
$this->assertThat( | ||
$rule->test($xml->field[0], 'bogus'), | ||
$this->isFalse(), | ||
'Line:' . __LINE__ . ' The rule should fail and return false.' | ||
); | ||
$this->assertTrue($rule->test($xml->field[0], '[email protected]')); | ||
} | ||
|
||
// Test pass conditions. | ||
/** | ||
* Test if an invalid Email result in false for the testing method JFormRuleEmail::test method. | ||
* | ||
* @return void | ||
*/ | ||
public function testAnInvalidEmail() | ||
{ | ||
$rule = new JFormRuleEmail; | ||
$xml = simplexml_load_string('<form><field name="email1" /><field name="email2" unique="true" /></form>'); | ||
|
||
$this->assertThat( | ||
$rule->test($xml->field[0], '[email protected]'), | ||
$this->isTrue(), | ||
'Line:' . __LINE__ . ' The basic rule should pass and return true.' | ||
); | ||
// Test fail conditions. | ||
$this->assertFalse($rule->test($xml->field[0], 'ThisIsNotALoveSong')); | ||
} | ||
|
||
|
||
/** | ||
* Data Provider for email rule test with no multiple attribute and no tld attribute | ||
* | ||
|
@@ -125,6 +126,7 @@ public function testEmailData2($emailAddress, $expectedResult) | |
$emailAddress . ' should have returned ' . ($expectedResult ? 'true' : 'false') . ' but did not' | ||
); | ||
} | ||
|
||
/** | ||
* Data Provider for email rule test with tld attribute | ||
* | ||
|
@@ -136,8 +138,8 @@ public function emailData3() | |
{ | ||
return array( | ||
array('[email protected]', true), | ||
array('test3@localhost', false), | ||
array('[email protected]', false), | ||
array('test3@localhost', true), | ||
array('[email protected]', true), | ||
array('[email protected]', true), | ||
array('[email protected]', true), | ||
); | ||
|
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 |
---|---|---|
|
@@ -271,6 +271,7 @@ public function dataIsEmailAddress() | |
array("[email protected]", false), | ||
array("joe<>[email protected]", false), | ||
array("joe&[email protected]", true), | ||
array("[email protected]", true), | ||
array("[email protected]", true), | ||
array("[email protected]", false), | ||
array("[email protected]", true), | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both regex a same now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost but not quite - look at the final few characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sry, i wanted mean like line 26 https://github.com/infograf768/joomla-cms/blob/2d33d95df58f6da7a2d6ea32a345c02648c5fb2b/libraries/joomla/form/rule/email.php#L26