Ejemplo n.º 1
0
 public function getCredentials()
 {
     $credentials = new Credentials();
     if (isset($_POST[self::$login])) {
         $username = $this->getRequestUserName();
         $password = $this->getRequestPassword();
         if (empty($username)) {
             $this->message = "Username is missing";
         } else {
             if (empty($password)) {
                 $this->message = "Password is missing";
             } else {
                 $credentials->setUsername($username);
                 $credentials->setPassword($password);
             }
         }
     } else {
         $credentials->setUsername(CookieHelper::get(self::$cookieName));
         $credentials->setTemporaryPassword(CookieHelper::get(self::$cookiePassword));
     }
     return $credentials;
 }
 public function testContainsPassword()
 {
     $c = new Credentials();
     $c->setPassword('Kalle');
     $this->assertEquals($c->getPassword(), 'Kalle');
 }