3 namespace Drupal\Tests\system\Functional\Session;
5 use Drupal\Core\EventSubscriber\MainContentViewSubscriber;
6 use Drupal\Tests\BrowserTestBase;
9 * Tests the stacked session handler functionality.
13 class StackSessionHandlerIntegrationTest extends BrowserTestBase {
18 protected static $modules = ['session_test'];
23 public function testRequest() {
24 $options['query'][MainContentViewSubscriber::WRAPPER_FORMAT] = 'drupal_ajax';
25 $headers[] = 'X-Requested-With: XMLHttpRequest';
26 $actual_trace = json_decode($this->drupalGet('session-test/trace-handler', $options, $headers));
27 $sessionId = $this->getSessionCookies()->getCookieByName($this->getSessionName())->getValue();
29 ['BEGIN', 'test_argument', 'open'],
30 ['BEGIN', NULL, 'open'],
31 ['END', NULL, 'open'],
32 ['END', 'test_argument', 'open'],
33 ['BEGIN', 'test_argument', 'read', $sessionId],
34 ['BEGIN', NULL, 'read', $sessionId],
35 ['END', NULL, 'read', $sessionId],
36 ['END', 'test_argument', 'read', $sessionId],
37 ['BEGIN', 'test_argument', 'write', $sessionId],
38 ['BEGIN', NULL, 'write', $sessionId],
39 ['END', NULL, 'write', $sessionId],
40 ['END', 'test_argument', 'write', $sessionId],
41 ['BEGIN', 'test_argument', 'close'],
42 ['BEGIN', NULL, 'close'],
43 ['END', NULL, 'close'],
44 ['END', 'test_argument', 'close'],
46 $this->assertEqual($expect_trace, $actual_trace);