class StackSessionHandlerIntegrationTest
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/Session/StackSessionHandlerIntegrationTest.php \Drupal\Tests\system\Functional\Session\StackSessionHandlerIntegrationTest
- 10 core/modules/system/tests/src/Functional/Session/StackSessionHandlerIntegrationTest.php \Drupal\Tests\system\Functional\Session\StackSessionHandlerIntegrationTest
- 8.9.x core/modules/system/tests/src/Functional/Session/StackSessionHandlerIntegrationTest.php \Drupal\Tests\system\Functional\Session\StackSessionHandlerIntegrationTest
Tests the stacked session handler functionality.
@group Session
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Functional\Session\StackSessionHandlerIntegrationTest extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of StackSessionHandlerIntegrationTest
File
-
core/
modules/ system/ tests/ src/ Functional/ Session/ StackSessionHandlerIntegrationTest.php, line 13
Namespace
Drupal\Tests\system\Functional\SessionView source
class StackSessionHandlerIntegrationTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'session_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests a request.
*/
public function testRequest() {
$options['query'][MainContentViewSubscriber::WRAPPER_FORMAT] = 'drupal_ajax';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$actual_trace = json_decode($this->drupalGet('session-test/trace-handler', $options, $headers));
$sessionId = $this->getSessionCookies()
->getCookieByName($this->getSessionName())
->getValue();
$expect_trace = [
[
'BEGIN',
'test_argument',
'open',
],
[
'BEGIN',
NULL,
'open',
],
[
'END',
NULL,
'open',
],
[
'END',
'test_argument',
'open',
],
[
'BEGIN',
'test_argument',
'read',
$sessionId,
],
[
'BEGIN',
NULL,
'read',
$sessionId,
],
[
'END',
NULL,
'read',
$sessionId,
],
[
'END',
'test_argument',
'read',
$sessionId,
],
[
'BEGIN',
'test_argument',
'write',
$sessionId,
],
[
'BEGIN',
NULL,
'write',
$sessionId,
],
[
'END',
NULL,
'write',
$sessionId,
],
[
'END',
'test_argument',
'write',
$sessionId,
],
[
'BEGIN',
'test_argument',
'close',
],
[
'BEGIN',
NULL,
'close',
],
[
'END',
NULL,
'close',
],
[
'END',
'test_argument',
'close',
],
];
$this->assertEquals($expect_trace, $actual_trace);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.