function SessionTest::assertSessionCookie
Same name in other branches
- 8.9.x core/modules/system/tests/src/Functional/Session/SessionTest.php \Drupal\Tests\system\Functional\Session\SessionTest::assertSessionCookie()
- 10 core/modules/system/tests/src/Functional/Session/SessionTest.php \Drupal\Tests\system\Functional\Session\SessionTest::assertSessionCookie()
- 11.x core/modules/system/tests/src/Functional/Session/SessionTest.php \Drupal\Tests\system\Functional\Session\SessionTest::assertSessionCookie()
Assert whether the SimpleTest browser sent a session cookie.
@internal
3 calls to SessionTest::assertSessionCookie()
- SessionTest::testEmptyAnonymousSession in core/
modules/ system/ tests/ src/ Functional/ Session/ SessionTest.php - Tests that empty anonymous sessions are destroyed.
- SessionTest::testSessionBag in core/
modules/ system/ tests/ src/ Functional/ Session/ SessionTest.php - Tests session bag.
- 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 379
Class
- SessionTest
- Drupal session handling tests.
Namespace
Drupal\Tests\system\Functional\SessionCode
public function assertSessionCookie(bool $sent) : void {
if ($sent) {
$this->assertNotEmpty($this->getSessionCookies()
->count(), 'Session cookie was sent.');
}
else {
$this->assertEmpty($this->getSessionCookies()
->count(), 'Session cookie was not sent.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.