Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MockArraySessionStorage.php

function MockArraySessionStorage::save

Overrides SessionStorageInterface::save

1 method overrides MockArraySessionStorage::save()
MockFileSessionStorage::save in vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php
Force the session to be saved and closed.

File

vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php, line 104

Class

MockArraySessionStorage
MockArraySessionStorage mocks the session for unit tests.

Namespace

Symfony\Component\HttpFoundation\Session\Storage

Code

public function save() : void {
    if (!$this->started || $this->closed) {
        throw new \RuntimeException('Trying to save a session that was not started yet or was already closed.');
    }
    // nothing to do since we don't persist the session data
    $this->closed = false;
    $this->started = false;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal