r79911 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79910‎ | r79911 | r79912 >
Date:19:06, 9 January 2011
Author:hashar
Status:ok
Tags:
Comment:
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!
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/UserIsValidEmailAddrTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/UserIsValidEmailAddrTest.php
@@ -31,10 +31,10 @@
3232 $this->valid( 'user+@example.com' );
3333 }
3434 function testEmailWithWhiteSpacesBeforeOrAfterAreInvalids() {
35 - $this->invalid( " user@host" );
36 - $this->invalid( "user@host " );
37 - $this->invalid( "\tuser@host" );
38 - $this->invalid( "user@host\t" );
 35+ $this->invalid( " user@host.com" );
 36+ $this->invalid( "user@host.com " );
 37+ $this->invalid( "\tuser@host.com" );
 38+ $this->invalid( "user@host.com\t" );
3939 }
4040 function testEmailWithWhiteSpacesAreInvalids() {
4141 $this->invalid( "User user@host" );

Status & tagging log