diff options
author | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2009-11-20 17:40:20 +0000 |
---|---|---|
committer | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2009-11-20 17:40:20 +0000 |
commit | fdaee8f05db04b5ddbf3a85fac5f313041bd6daa (patch) | |
tree | fe2abdb5e797ff06c820d5a4f002af78eae9a128 /tests | |
parent | cd925c306710c06445e9b4e49ee86adfa43ad54a (diff) | |
download | semanticscuttle-fdaee8f05db04b5ddbf3a85fac5f313041bd6daa.tar.gz semanticscuttle-fdaee8f05db04b5ddbf3a85fac5f313041bd6daa.tar.bz2 |
test email validation
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@567 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'tests')
-rw-r--r-- | tests/UserTest.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/UserTest.php b/tests/UserTest.php index a68d7dc..c182d87 100644 --- a/tests/UserTest.php +++ b/tests/UserTest.php @@ -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') + ); + } + } |