CodeExplorer setTokenStorage example
public function testGetRequest() { $this->
setRequestStack($request =
new Request());
$this->
assertEquals($request,
$this->appVariable->
getRequest());
} public function testGetToken() { $tokenStorage =
$this->
createMock(TokenStorageInterface::
class);
$this->appVariable->
setTokenStorage($tokenStorage);
$token =
$this->
createMock(TokenInterface::
class);
$tokenStorage->
method('getToken'
)->
willReturn($token);
$this->
assertEquals($token,
$this->appVariable->
getToken());
} public function testGetUser() { $this->
setTokenStorage($user =
$this->
createMock(UserInterface::
class));
$clonedRequest->server->
remove($key);
} } $this->request =
$clonedRequest;
return $clonedRequest;
} public function setTokenStorage(TokenStorageInterface
$tokenStorage): void
{ $this->appVariable->
setTokenStorage($tokenStorage);
} public function setRequestStack(RequestStack
$requestStack): void
{ $this->appVariable->
setRequestStack($requestStack);
} public function setEnvironment(string
$environment): void
{ $this->appVariable->
setEnvironment($environment);
}