function SessionTest::sessionReset

Same name in other branches
  1. 8.9.x core/modules/system/tests/src/Functional/Session/SessionTest.php \Drupal\Tests\system\Functional\Session\SessionTest::sessionReset()
  2. 10 core/modules/system/tests/src/Functional/Session/SessionTest.php \Drupal\Tests\system\Functional\Session\SessionTest::sessionReset()
  3. 11.x core/modules/system/tests/src/Functional/Session/SessionTest.php \Drupal\Tests\system\Functional\Session\SessionTest::sessionReset()

Reset the cookie file so that it refers to the specified user.

2 calls to SessionTest::sessionReset()
SessionTest::testDataPersistence in core/modules/system/tests/src/Functional/Session/SessionTest.php
Tests data persistence via the session_test module callbacks.
SessionTest::testSessionSaveRegenerate in core/modules/system/tests/src/Functional/Session/SessionTest.php
Tests session writing and regeneration.

File

core/modules/system/tests/src/Functional/Session/SessionTest.php, line 364

Class

SessionTest
Drupal session handling tests.

Namespace

Drupal\Tests\system\Functional\Session

Code

public function sessionReset() {
    // Close the internal browser.
    $this->mink
        ->resetSessions();
    $this->loggedInUser = FALSE;
    // Change cookie file for user.
    $this->drupalGet('session-test/get');
    $this->assertSession()
        ->statusCodeEquals(200);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.