$sessionId =
$session->
getId();
$usageIndex =
$session->
getUsageIndex();
$event =
new ResponseEvent( $this->
createMock(HttpKernelInterface::
class),
$request,
HttpKernelInterface::MAIN_REQUEST,
new Response() );
$listener =
new ContextListener($tokenStorage,
[], 'session', null,
new EventDispatcher(), null,
$tokenStorage->
enableUsageTracking(...
));
$listener->
onKernelResponse($event);
if ($session->
getId() ===
$sessionId) { $this->
assertSame($usageIndex,
$session->
getUsageIndex());
} else { $this->
assertNotSame($usageIndex,
$session->
getUsageIndex());
} return $session;
}