public function testJsonSerialize()
 {
     $this->wrappedSessionWillBeLoaded();
     $this->wrappedSession->expects($this->at(0))->method('jsonSerialize')->willReturn('foo');
     $this->wrappedSession->expects($this->at(1))->method('jsonSerialize')->willReturn('bar');
     self::assertSame('foo', $this->lazySession->jsonSerialize());
     self::assertSame('bar', $this->lazySession->jsonSerialize());
 }
 /**
  * @param SessionInterface $sessionContainer
  * @param Response         $response
  * @param Token            $token
  *
  * @return Response
  *
  * @throws \InvalidArgumentException
  */
 private function appendToken(SessionInterface $sessionContainer, Response $response, Token $token = null) : Response
 {
     $sessionContainerChanged = $sessionContainer->hasChanged();
     if ($sessionContainerChanged && $sessionContainer->isEmpty()) {
         return FigResponseCookies::set($response, $this->getExpirationCookie());
     }
     if ($sessionContainerChanged || $this->shouldTokenBeRefreshed($token) && !$sessionContainer->isEmpty()) {
         return FigResponseCookies::set($response, $this->getTokenCookie($sessionContainer));
     }
     return $response;
 }