You are here

function SessionTest::assertSessionEmpty in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Session/SessionTest.php \Drupal\system\Tests\Session\SessionTest::assertSessionEmpty()

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

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

File

core/modules/system/src/Tests/Session/SessionTest.php, line 320
Contains \Drupal\system\Tests\Session\SessionTest.

Class

SessionTest
Drupal session handling tests.

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.');
  }
}