function SessionTest::assertSessionEmpty

Assert whether $_SESSION is empty at the beginning of the request.

1 call to SessionTest::assertSessionEmpty()
SessionTest::testEmptyAnonymousSession in drupal/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php
Test that empty anonymous sessions are destroyed.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php, line 303
Definition of Drupal\system\Tests\Session\SessionTest.

Class

SessionTest

Namespace

Drupal\system\Tests\Session

Code

function assertSessionEmpty($empty) {
  if ($empty) {
    $this
      ->assertIdentical($this
      ->drupalGetHeader('X-Session-Empty'), '1', 'Session was empty.');
  }
  else {
    $this
      ->assertIdentical($this
      ->drupalGetHeader('X-Session-Empty'), '0', 'Session was not empty.');
  }
}