Exemplo n.º 1
0
 public function testSetPasswordReturnsFalseWhenPasswordLengthIsTooShort()
 {
     $details = array();
     $user = new User($details);
     $password = '******';
     $result = $user->setPassword($password);
     $this->assertFalse($result);
 }
Exemplo n.º 2
0
 public function testGetUserReturnsUserWithExpectedValues()
 {
     $details = array();
     $user = new User($details);
     $password = '******';
     $user->setPassword($password);
     $expectedPasswordResult = '5185e8b8fd8a71fc80545e144f91faf2';
     $currentUser = $user->getUser();
     $this->assertEquals($expectedPasswordResult, $currentUser['password']);
     $cryptedPassword = $this->invokeMethod($user, 'cryptPassword', array($password));
     $this->assertEquals($expectedPasswordResult, $cryptedPassword);
 }