public function testSetToken()
 {
     $this->session->expects($this->once())->method('set')->with('requesttoken', 'TokenToSet');
     $this->sessionStorage->setToken('TokenToSet');
 }
 /**
  * Invalidates any current token and sets a new one.
  *
  * @return CsrfToken
  */
 public function refreshToken()
 {
     $value = $this->tokenGenerator->generateToken();
     $this->sessionStorage->setToken($value);
     return new CsrfToken($value);
 }