Example #1
0
 public function generateLink()
 {
     $link = new Link();
     $link->email = $this->email;
     $link->generateToken();
     return $link->save(false) && empty($this->getErrors()) ? $link : null;
 }
Example #2
0
 public function testSaveLink()
 {
     $link = new Link();
     $link->email = "*****@*****.**";
     $link->generateToken();
     $token = $link->token;
     $this->assertTrue($link->save());
     $this->tester->seeInDatabase('links', ['email' => '*****@*****.**', 'token' => $token]);
 }