/** @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'); }
/** * 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); }