/** @test */
 public function activateCannotFindUserForEmail()
 {
     $this->codes->shouldReceive('retrieveEmailByCode')->with('foo')->andReturn('*****@*****.**');
     $this->users->shouldReceive('retrieveByCredentials')->with(['email' => '*****@*****.**'])->andReturn(null);
     $this->setExpectedException('anlutro\\Core\\Auth\\Activation\\ActivationException');
     $this->activation->activate('foo');
 }
Exemple #2
0
 /**
  * Given an activation code, activate the user.
  *
  * @param  string $code
  *
  * @return void
  */
 public function activateByCode($code)
 {
     if ($this->activations === null) {
         throw new \RuntimeException('Activation service not set.');
     }
     $this->activations->activate($code);
 }