From: Antoine Musso Date: Sun, 9 Jan 2011 19:06:02 +0000 (+0000) Subject: Add a .tld to emails when testing for white space before/after. X-Git-Tag: 1.31.0-rc.0~32660 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=c59480ada3cca1b2bec63353e4c496857e6e476c;p=lhc%2Fweb%2Fwiklou.git 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! --- 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" );