You are here

public function StackSessionHandlerIntegrationTest::testRequest in Zircon Profile 8

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

Tests a request.

File

core/modules/system/src/Tests/Session/StackSessionHandlerIntegrationTest.php, line 29
Contains \Drupal\system\Tests\Session\StackSessionHandlerIntegrationTest.

Class

StackSessionHandlerIntegrationTest
Tests the stacked session handler functionality.

Namespace

Drupal\system\Tests\Session

Code

public function testRequest() {
  $actual_trace = $this
    ->drupalGetAjax('session-test/trace-handler');
  $expect_trace = [
    [
      'BEGIN',
      'test_argument',
      'open',
    ],
    [
      'BEGIN',
      NULL,
      'open',
    ],
    [
      'END',
      NULL,
      'open',
    ],
    [
      'END',
      'test_argument',
      'open',
    ],
    [
      'BEGIN',
      'test_argument',
      'read',
      $this->sessionId,
    ],
    [
      'BEGIN',
      NULL,
      'read',
      $this->sessionId,
    ],
    [
      'END',
      NULL,
      'read',
      $this->sessionId,
    ],
    [
      'END',
      'test_argument',
      'read',
      $this->sessionId,
    ],
    [
      'BEGIN',
      'test_argument',
      'write',
      $this->sessionId,
    ],
    [
      'BEGIN',
      NULL,
      'write',
      $this->sessionId,
    ],
    [
      'END',
      NULL,
      'write',
      $this->sessionId,
    ],
    [
      'END',
      'test_argument',
      'write',
      $this->sessionId,
    ],
    [
      'BEGIN',
      'test_argument',
      'close',
    ],
    [
      'BEGIN',
      NULL,
      'close',
    ],
    [
      'END',
      NULL,
      'close',
    ],
    [
      'END',
      'test_argument',
      'close',
    ],
  ];
  $this
    ->assertEqual($expect_trace, $actual_trace);
}