Exemple #1
0
 public function testRememberLogin()
 {
     $person = new Person(['id' => 1, 'remember_token' => 'token']);
     $auth = $this->getMockBuilder(Auth::class)->setConstructorArgs([$this->getMockSession(), $this->getMockPersonRepository(), $this->getMockPermissionsProvider()])->setMethods(['saveRememberLoginToken'])->getMock();
     Cookie::shouldReceive('queue')->once();
     Cookie::shouldReceive('forever')->once()->with($auth->getAutoLoginCookie(), $person->getId() . '-' . $person->getRememberToken());
     $auth->rememberLogin($person);
 }