test new method SemanticScuttle_Service_User::userEmailCombinationValid() used in password forgotten page
This commit is contained in:
parent
2aa12b2534
commit
badc3b87ee
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user