test email validation
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@567 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
cd925c3067
commit
fdaee8f05d
1 changed files with 36 additions and 0 deletions
|
@ -164,6 +164,42 @@ class UserTest extends TestBase
|
|||
$this->assertType('SemanticScuttle_Model_User', reset($users));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Test if the email validation function works
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIsValidEmail()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->us->isValidEmail('foo@example.org')
|
||||
);
|
||||
$this->assertTrue(
|
||||
$this->us->isValidEmail('foo-bar@semantic-scuttle.example.net')
|
||||
);
|
||||
$this->assertTrue(
|
||||
$this->us->isValidEmail('2334ABC@302.example.org')
|
||||
);
|
||||
|
||||
$this->assertFalse(
|
||||
$this->us->isValidEmail('302.example.org')
|
||||
);
|
||||
$this->assertFalse(
|
||||
$this->us->isValidEmail('foo@302')
|
||||
);
|
||||
$this->assertFalse(
|
||||
$this->us->isValidEmail('foo@example!org')
|
||||
);
|
||||
$this->assertFalse(
|
||||
$this->us->isValidEmail('foo@@example.org')
|
||||
);
|
||||
$this->assertFalse(
|
||||
$this->us->isValidEmail('f@oo@example.org')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue