public function testKeyCode()
 {
     $value = new UserActivation();
     $value->buildKeyCode(new ActivationKeyCodeGenerator());
     $bareValue = $value->getKeyCode();
     $this->assertTrue($value->compareKeyCode($bareValue));
 }
Exemplo n.º 2
0
 public function testActivateUser()
 {
     $activation = new UserActivation();
     $activation->buildKeyCode(new ActivationKeyCodeGenerator());
     $code = $activation->getKeyCode();
     $user = User::fromDTO(new CreateUserDTO('test', '123456', '*****@*****.**'), $activation);
     $user->activate($code);
     $this->assertTrue($user->isActivated());
 }
Exemplo n.º 3
0
 /**
  * Checks if the user is activated
  *
  * @return boolean
  */
 public function isActivated()
 {
     return null === $this->activation || null === $this->activation->getKeyCode();
 }