public function SessionTest::testSessionPersistenceOnLogin in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/Session/SessionTest.php \Drupal\system\Tests\Session\SessionTest::testSessionPersistenceOnLogin()
Tests storing data in Session() object.
File
- core/
modules/ system/ src/ Tests/ Session/ SessionTest.php, line 143 - Contains \Drupal\system\Tests\Session\SessionTest.
Class
- SessionTest
- Drupal session handling tests.
Namespace
Drupal\system\Tests\SessionCode
public function testSessionPersistenceOnLogin() {
// Store information via hook_user_login().
$user = $this
->drupalCreateUser();
$this
->drupalLogin($user);
// Test property added to session object form hook_user_login().
$this
->drupalGet('session-test/get-from-session-object');
$this
->assertText('foobar', 'Session data is saved in Session() object.', 'Session');
}