/**
  * @depends testClass
  */
 public function testNoAccessToken()
 {
     $storage = $this->getMockBuilder(TokenStorageInterface::class)->getMock();
     $exception = StorageException::noAccessToken($storage);
     $this->assertInstanceOf(StorageException::class, $exception);
     $this->assertEquals(sprintf('No access token in %s', get_class($storage)), $exception->getMessage());
 }
 /**
  * @inheritDoc
  */
 public function retrieveAccessToken()
 {
     if (false === $this->hasAccessToken()) {
         throw StorageException::noAccessToken($this);
     }
     $token = unserialize($_SESSION[$this->sessionName]);
     return true === $token instanceof TokenInterface ? $token : null;
 }