From c59480ada3cca1b2bec63353e4c496857e6e476c Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 9 Jan 2011 19:06:02 +0000 Subject: [PATCH] Add a .tld to emails when testing for white space before/after. This might avoid confusion when testing. Currently, an email without a tld is invalid (ex user@host). The assertions could have been invalid just by the lack of tld, not the spaces! --- tests/phpunit/includes/UserIsValidEmailAddrTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/includes/UserIsValidEmailAddrTest.php b/tests/phpunit/includes/UserIsValidEmailAddrTest.php index 6b5ff6830c..2a100a9355 100644 --- a/tests/phpunit/includes/UserIsValidEmailAddrTest.php +++ b/tests/phpunit/includes/UserIsValidEmailAddrTest.php @@ -31,10 +31,10 @@ class UserIsValidEmailAddrTest extends MediaWikiTestCase { $this->valid( 'user+@example.com' ); } function testEmailWithWhiteSpacesBeforeOrAfterAreInvalids() { - $this->invalid( " user@host" ); - $this->invalid( "user@host " ); - $this->invalid( "\tuser@host" ); - $this->invalid( "user@host\t" ); + $this->invalid( " user@host.com" ); + $this->invalid( "user@host.com " ); + $this->invalid( "\tuser@host.com" ); + $this->invalid( "user@host.com\t" ); } function testEmailWithWhiteSpacesAreInvalids() { $this->invalid( "User user@host" ); -- 2.20.1