summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/UserTest.php67
1 files changed, 67 insertions, 0 deletions
diff --git a/tests/UserTest.php b/tests/UserTest.php
index 49f3730..f0a7427 100644
--- a/tests/UserTest.php
+++ b/tests/UserTest.php
@@ -106,6 +106,73 @@ class UserTest extends TestBase
/**
+ * Test userEmailCombinationValid() with valid user
+ * and valid email address.
+ *
+ * @return void
+ */
+ public function testUserEmailCombinationValid()
+ {
+ $this->us->deleteAll();
+
+ $uid = $this->addUser();
+ $user = $this->us->getUser($uid);
+ $email = $user['email'];
+ $name = $user['username'];
+ $this->assertTrue(
+ $this->us->userEmailCombinationValid(
+ $name, $email
+ )
+ );
+ }
+
+
+
+ /**
+ * Test userEmailCombinationValid() with valid user and invalid email.
+ *
+ * @return void
+ */
+ public function testUserEmailCombinationValidInvalidEmail()
+ {
+ $this->us->deleteAll();
+
+ $uid = $this->addUser();
+ $user = $this->us->getUser($uid);
+ $email = $user['email'];
+ $name = $user['username'];
+ $this->assertFalse(
+ $this->us->userEmailCombinationValid(
+ $name, 'not-' . $email
+ )
+ );
+ }
+
+
+
+ /**
+ * Test userEmailCombinationValid() with invalid user and invalid email.
+ *
+ * @return void
+ */
+ public function testUserEmailCombinationValidBothInvalid()
+ {
+ $this->us->deleteAll();
+
+ $uid = $this->addUser();
+ $user = $this->us->getUser($uid);
+ $email = $user['email'];
+ $name = $user['username'];
+ $this->assertFalse(
+ $this->us->userEmailCombinationValid(
+ 'not-' . $name, 'not-' . $email
+ )
+ );
+ }
+
+
+
+ /**
* Test login() function with invalid creditentials
*
* @return void