Add a .tld to emails when testing for white space before/after.
authorAntoine Musso <hashar@users.mediawiki.org>
Sun, 9 Jan 2011 19:06:02 +0000 (19:06 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Sun, 9 Jan 2011 19:06:02 +0000 (19:06 +0000)
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

index 6b5ff68..2a100a9 100644 (file)
@@ -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" );