Exemple #1
0
 public function loginSuccessful(Credentials $credentials)
 {
     if (isset($_POST[self::$keep])) {
         $expiration = $credentials->getTemporaryExpiration();
         CookieHelper::set(self::$cookieName, $credentials->getUsername(), $expiration);
         CookieHelper::set(self::$cookiePassword, $credentials->getTemporaryPassword(), $expiration);
     }
     \Primitive\Tools::redirect();
 }
 public function testContainsUsername()
 {
     $c = new Credentials();
     $c->setUsername('Gandalf');
     $this->assertEquals($c->getUsername(), 'Gandalf');
 }